|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
HI!
I try to login and read ad email in server. Does any one know how to do this? Below does not run correctly. Regards, Yui p.s I try to see pop3 email. I can not find the example! <?php $host = "abc.com"; $port = 110; $user ='test@abc.com'; $pwd ='password'; $fp = fsockopen($host, $port); // $B%m%0%$%s(B fputs($fp,"USER $user\r\n"); // USE $line = fgets($fp, 512); fputs($fp,"PASS $pwd\r\n"); // pwd $line = fgets($fp, 512); echo $line; if( !eregi("OK", $line) ) // login faile$B!)(Bif( !eregi("OK", $line) ) //ogin faile$B!)(B { echo "fail"; fclose($fp); return false; } echo "sucess"; ?> > > > > > > 2008/1/1, Richard Lynch <ceo@l-i-e.com>: > >> > >> PHP's IMAP module will cheerfully use POP if you insist on it. > >> > >> You don't have to READ the email with IMAP. > >> > >> You can just re-arrange all your folders or do whatever it is you > >> want > >> it to do... > >> > >> You keep asking the same questions, and I keep telling you IMAP will > >> do it. > >> > >> maybe you should try it? > >> > >> On Mon, December 31, 2007 1:17 am, Yui Hiroaki wrote: > >> > Thank you! > >> > > >> > But I would like to use pop. > >> > > >> > Because I do not want display the email. > >> > I just access and get email. > >> > > >> > Please teach me some advise. > >> > Yui > >> > > >> > 2007/12/31, Richard Lynch <ceo@l-i-e.com>: > >> >> > >> >> On Sun, December 30, 2007 2:19 pm, Yui Hiroaki wrote: > >> >> > HI! > >> >> > > >> >> > I am trying to access qmail with php. > >> >> > > >> >> > Why! > >> >> > Because I would like to read mail who someone send an email me > >> to > >> >> > qmail. > >> >> > > >> >> > If anyone knows the code, please send me the code. > >> >> > >> >> http://php.net/imap > >> >> > >> >> Sample Code: > >> >> > >> >> http://l-i-e.com/imap/index.phps > >> >> > >> >> Some spam filtering I set up to catch what slips through spam > >> >> assasin > >> >> and get the email sorted server-side rather than have my desktop > >> >> client CHOKES trying to sort out thousands of emails upon > >> login... > >> >> > >> >> -- > >> >> Some people have a "gift" link here. > >> >> Know what I want? > >> >> I want you to buy a CD from some indie artist. > >> >> http://cdbaby.com/from/lynch > >> >> Yeah, I get a buck. So? > >> >> > >> >> > >> > > >> > >> > >> -- > >> Some people have a "gift" link here. > >> Know what I want? > >> I want you to buy a CD from some indie artist. > >> http://cdbaby.com/from/lynch > >> Yeah, I get a buck. So? > >> > >> > > > > > -- > Some people have a "gift" link here. > Know what I want? > I want you to buy a CD from some indie artist. > http://cdbaby.com/from/lynch > Yeah, I get a buck. So? > > |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On Saturday 05 January 2008 22:06:47 Yui Hiroaki wrote:
> HI! > > I try to login and read ad email in server. > Does any one know how to do this? > Below does not run correctly. right, the line: if( !eregi("OK", $line) ) // login faile?if( !eregi("OK", $line) ) //ogin faile? it looks just like this? without reading the code it strikes me as odd if it does. > > Regards, > Yui > > p.s > I try to see pop3 email. > I can not find the example! > > <?php > > $host = "abc.com"; > $port = 110; > $user ='test@abc.com'; > $pwd ='password'; > > $fp = fsockopen($host, $port); > > // ãƒã‚°ã‚¤ãƒ³ > fputs($fp,"USER $user\r\n"); // USE > $line = fgets($fp, 512); > > > fputs($fp,"PASS $pwd\r\n"); // pwd > $line = fgets($fp, 512); > echo $line; > > if( !eregi("OK", $line) ) // login faile?if( !eregi("OK", $line) ) //ogin > faile? > { > echo "fail"; > fclose($fp); > return false; > } > echo "sucess"; > ?> > > > > 2008/1/1, Richard Lynch <ceo@l-i-e.com>: > > >> PHP's IMAP module will cheerfully use POP if you insist on it. > > >> > > >> You don't have to READ the email with IMAP. > > >> > > >> You can just re-arrange all your folders or do whatever it is you > > >> want > > >> it to do... > > >> > > >> You keep asking the same questions, and I keep telling you IMAP will > > >> do it. > > >> > > >> maybe you should try it? > > >> > > >> On Mon, December 31, 2007 1:17 am, Yui Hiroaki wrote: > > >> > Thank you! > > >> > > > >> > But I would like to use pop. > > >> > > > >> > Because I do not want display the email. > > >> > I just access and get email. > > >> > > > >> > Please teach me some advise. > > >> > Yui > > >> > > > >> > 2007/12/31, Richard Lynch <ceo@l-i-e.com>: > > >> >> On Sun, December 30, 2007 2:19 pm, Yui Hiroaki wrote: > > >> >> > HI! > > >> >> > > > >> >> > I am trying to access qmail with php. > > >> >> > > > >> >> > Why! > > >> >> > Because I would like to read mail who someone send an email me > > >> > > >> to > > >> > > >> >> > qmail. > > >> >> > > > >> >> > If anyone knows the code, please send me the code. > > >> >> > > >> >> http://php.net/imap > > >> >> > > >> >> Sample Code: > > >> >> > > >> >> http://l-i-e.com/imap/index.phps > > >> >> > > >> >> Some spam filtering I set up to catch what slips through spam > > >> >> assasin > > >> >> and get the email sorted server-side rather than have my desktop > > >> >> client CHOKES trying to sort out thousands of emails upon > > >> > > >> login... > > >> > > >> >> -- > > >> >> Some people have a "gift" link here. > > >> >> Know what I want? > > >> >> I want you to buy a CD from some indie artist. > > >> >> http://cdbaby.com/from/lynch > > >> >> Yeah, I get a buck. So? > > >> > > >> -- > > >> Some people have a "gift" link here. > > >> Know what I want? > > >> I want you to buy a CD from some indie artist. > > >> http://cdbaby.com/from/lynch > > >> Yeah, I get a buck. So? > > > > -- > > Some people have a "gift" link here. > > Know what I want? > > I want you to buy a CD from some indie artist. > > http://cdbaby.com/from/lynch > > Yeah, I get a buck. So? -- --- Børge Holen http://www.arivene.net |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Hello,
on 01/05/2008 07:06 PM Yui Hiroaki said the following: > HI! > > I try to login and read ad email in server. > Does any one know how to do this? > Below does not run correctly. > > Regards, > Yui > > p.s > I try to see pop3 email. > I can not find the example! As I mentioned before POP3 is more complex than that. You are just authenticating. You need to list the messages in the mailbox and retrieve them. I suggest that you use this popular PHP POP3 client class. It works so elegantly that you can even access messages in your mailbox as if they were files, with a single line like this: $message = file_get_contents('pop3://user:password@pop3.yourdomain.com/1'); This gets you the whole message with headers into the $message variable. If you want to analyze the message to extract the relevant information, you can use the MIME parser class and with just a few more lines it will tell you if it is a text message, HTML message, extract any attachments, etc. http://www.phpclasses.org/mimeparser -- Regards, Manuel Lemos PHP professionals looking for PHP jobs http://www.phpclasses.org/professionals/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ |
|
![]() |
| Outils de la discussion | |
|
|