Theory or process to reading a POP3 / IMAP mailbox?

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
peterg0123
Forum Newbie
Posts: 2
Joined: Tue Nov 25, 2008 12:27 am

Theory or process to reading a POP3 / IMAP mailbox?

Post by peterg0123 »

Hi,

Can anyone tell me the process or steps (not code) to reading a mailbox and extracting the different sections / parts of a message.

I know you start with imap_open(), but not certain where to go from hear?
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Theory or process to reading a POP3 / IMAP mailbox?

Post by alex.barylski »

1. Connect to IMAP/POP3 account
2. Read in all messages in a mailbox
3. Iterate messages and parse their contents using imap_*

I would recommend finding an existing IMAP parsing class as the API is quite complex and confusing...I actually need to implement one myself here shortly
peterg0123
Forum Newbie
Posts: 2
Joined: Tue Nov 25, 2008 12:27 am

Re: Theory or process to reading a POP3 / IMAP mailbox?

Post by peterg0123 »

Thanks, I want to create the code myself, best way to I think to learn....

Could you possible get a little be more into detail into what function I need to use?
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Theory or process to reading a POP3 / IMAP mailbox?

Post by Eran »

Start with imap_open() - http://www.php.net/manual/en/function.imap-open.php and continue to the rest of the imap functions - http://www.php.net/manual/en/ref.imap.php (as spectra mentioned).

Pay attention to the examples shown in each page. That should give you plenty to go on.
Post Reply