Forum Moderators: coopster

Message Too Old, No Replies

Accessing SMTP mail with PHP

How do I extract, filter and read POP mail with PHP?

         

WeenerDawg

10:51 am on Apr 13, 2007 (gmt 0)

10+ Year Member



Hi guys,

To further my PHP experimentation I’m attempting to create a little tool to enable me to update my website via e-mail. (In essence the e-mail will be sent from a mobile phone).

My logic dictates that I need to create a special e-mail address (that’s easy). Now I need to write a php script to access the mailbox and extract the e-mail and its contents – the email subject, the contents and the e-mail attachment.

In theory this seems to be quite a simple task barring some filtering etc.

I’ve been searching the web for info on how to do this but I have only found hectically complicated libraries or nothing at all.

I think I might be searching with the wrong terms. Could someone point me in the right direction? What php elements do I have to research to accomplish these tasks?

Thanks guys!

Wd.

eelixduppy

10:58 am on Apr 13, 2007 (gmt 0)



Hello, and welcome to WebmasterWorld!

Take a look at the IMAP, POP3 and NNTP Functions [php.net]. There are some examples there that may help get you started.

Also, you should check phpclasses.org [google.com]because I'm sure there is a class there that has already been created. If there is a good enough readme.txt file, then it shouldn't be to hard to learn the class.

Good luck! :)

WeenerDawg

3:02 pm on Apr 13, 2007 (gmt 0)

10+ Year Member



Great man! I'm having a look at it now. :)