PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > login and read ad email
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
login and read ad email

Réponse
 
LinkBack Outils de la discussion
Vieux 05/01/2008, 21h06   #1
Yui Hiroaki
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut login and read ad email

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?
>
>


  Réponse avec citation
Vieux 05/01/2008, 22h31   #2
Børge Holen
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] login and read ad email

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
  Réponse avec citation
Vieux 07/01/2008, 04h30   #3
Manuel Lemos
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: login and read ad email

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/
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 17h31.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,27234 seconds with 11 queries