Hi All, Can anyone guide me a way to extract all the images that are part of the email body(not as attachment) in PHP. Please guide me if anyone has worked on this.
Regards, Justin Samuel.
From stackoverflow
-
If there is image on an email, this one should be html.
So the image are define with a HTML tag like that
<img.....>You have to look at the img HTML tag.
-
Parse the HTML part with
DOMDocument::loadHTML, get all<img>elements withgetElementsByTagName('img'), check thesrcattribute of each<img>element, download the image (for example, usingfile_get_contents).
0 comments:
Post a Comment