Email parsing with PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rajsekar2u
Forum Commoner
Posts: 71
Joined: Thu Nov 20, 2008 4:23 am

Email parsing with PHP

Post 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.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Email parsing with PHP

Post by requinix »

I'm sure there is. Have you asked Google yet?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Email parsing with PHP

Post 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
Post Reply