Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieve Entire Email (headers + all body parts) with PHP

Tags:

php

I found this script:

http://code.google.com/p/php-mime-mail-parser/

It does a much better job parsing the email than what I have concocted for one of my projects over the last year.

For this to work though, the input needs to be the raw text of the email, the entire header and body parts. I have not found a PHP imap function that returns the entire email.

Do you know of one, or is their a way to piece it together?

like image 770
timroman Avatar asked Mar 11 '11 12:03

timroman


1 Answers

imap_fetchheader can be used to retrieve the entire raw header and imap_body returns the entire body.

like image 122
krtek Avatar answered Oct 11 '22 22:10

krtek