dweb Posted September 10, 2014 Share Posted September 10, 2014 Hi I have the following code, which works fine. How can I pull in any images attached to the email and display them under the echo $val ? Thanks $mbox = imap_open("{SERVER}", "user", "pass"); echo "<h1>Mailboxes</h1>\n"; $folders = imap_listmailbox($mbox, "{SERVER}", "*"); if ($folders == false) { echo "Call failed<br />\n"; } else { foreach ($folders as $val) { echo $val . "<br />\n"; } } echo "<h1>INBOX</h1>\n"; $headers = imap_headers($mbox); if ($headers == false) { echo "Call failed<br />\n"; } else { $i=0; foreach ($headers as $val) { $i++; echo $val . "<br />\n"; } } imap_close($mbox); Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted September 10, 2014 Share Posted September 10, 2014 Why not. If the attached data is a part of the mail's content you could use regex to grep only those files. Quote Link to comment Share on other sites More sharing options...
CroNiX Posted September 10, 2014 Share Posted September 10, 2014 Did you happen to search for "php imap save attachment"? If it is truly an email attachment there are imap methods to retrieve it/them and then display or save them however you want. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.