By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,718 Members | 1,461 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,718 IT Pros & Developers. It's quick & easy.

POPing mail

P: n/a
I know that the IMAP library can be used to pop mail as well, but
the php.net documentation is not very clear (by this I mean
simple enough for me to understand).

Does anyone have a link or a resource that give simple examples ?

I need to retrieve some plain text or the plain text part of a
multipart email only.

bill
Jan 25 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
bill wrote:
I know that the IMAP library can be used to pop mail as well, but the
php.net documentation is not very clear (by this I mean simple enough
for me to understand).

Does anyone have a link or a resource that give simple examples ?

I need to retrieve some plain text or the plain text part of a
multipart email only.

bill
Bill,

I don't know of any tutorials but in my messing around with the IMAP
functions it seemed pretty easy. The functions are pretty self
explanatory as found on www.php.net so really try to remember the folowing:

1) connect to the mail server
2) obtain the number of messages (if needed)
3) or optionally search for a specific message
4) fetch the info you want
5) close the connection

A simple example would be:

$mailbox =
imap_open("{your.mailserver.com:110/pop3}INBOX","username","password");
$mailbox_status = imap_check($mailbox);
echo "<br>Mailbox status for {$mailbox_status->Mailbox}:<br>";
echo "System date: {$mailbox_status->Date}<br>";
echo "System driver: {$mailbox_status->Driver}<br>";
echo "Message count: {$mailbox_status->Nmsgs}<br>";
etc.
imap_close($mailbox);
---
you may be better off looking through www.phpclasses.org and finding a
pre-made class that will do all this for you.

Norm
---
Jan 26 '07 #2

P: n/a
Norman Peelman wrote:
bill wrote:
>I know that the IMAP library can be used to pop mail as well, but the
php.net documentation is not very clear (by this I mean simple enough
for me to understand).

Does anyone have a link or a resource that give simple examples ?

I need to retrieve some plain text or the plain text part of a
multipart email only.

bill

Bill,

I don't know of any tutorials but in my messing around with the IMAP
functions it seemed pretty easy. The functions are pretty self
explanatory as found on www.php.net so really try to remember the folowing:

1) connect to the mail server
2) obtain the number of messages (if needed)
3) or optionally search for a specific message
4) fetch the info you want
5) close the connection

A simple example would be:

$mailbox =
imap_open("{your.mailserver.com:110/pop3}INBOX","username","password");
$mailbox_status = imap_check($mailbox);
echo "<br>Mailbox status for {$mailbox_status->Mailbox}:<br>";
echo "System date: {$mailbox_status->Date}<br>";
echo "System driver: {$mailbox_status->Driver}<br>";
echo "Message count: {$mailbox_status->Nmsgs}<br>";
etc.
imap_close($mailbox);
---
you may be better off looking through www.phpclasses.org and finding a
pre-made class that will do all this for you.

Norm
---
THanks Norm
Jan 26 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.