Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find a way to use php to read html mails and convert to file 1

Status
Not open for further replies.

Hexes

Programmer
Oct 21, 2010
21
Good day all.

I need a little help with a challenging problem.
using imap in a php script i need to create a php script that will read HTML mails and
convert them to pdf or jpg or tiff files. the challenge is I need to preserve the images imbedded in the mails.
So the final pdf/tiff/jpg must have all text and images correctly preserved in them.
I'm not worried about the attachments other php scripts take care of them.
I'm mostly concerned about the Body of the mail.

Please help, any tips welcome
 
assuming you can extract the html part of the email then you need only deal with the cid.

parse the html for
, extract the corresponding parts from the email package and save it on your webserver somewhere. then replace the img tag with one that refers to the saved image file.

finally, run the raw html through wkhtmltopdf and then clean up your temp files
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top