Page 1 of 1

Email parsing with PHP

Posted: Fri Sep 24, 2010 1:49 am
by rajsekar2u
Can anyone tell me, Is there a class file to read and save the attachments from an email using pop3 account details. For now i've the code to read the email and print the email contents but i cant able to save it.

Please help me in this.

Re: Email parsing with PHP

Posted: Fri Sep 24, 2010 4:33 am
by requinix
I'm sure there is. Have you asked Google yet?

Re: Email parsing with PHP

Posted: Fri Sep 24, 2010 1:07 pm
by John Cartwright
You can use the imap() function family over a pop3 connection. Specifically the function you want is imap_fetchstructure(), however it is not exactly straight forward to extract the email parts.

This comment (and others on the page as well) has a helpful snippet that you may find useful