johnx Posted July 17, 2008 Share Posted July 17, 2008 Hello, I have big problem here. I need to create HTML email with images displayed in the body of the mail and I need to attach PDF document as normal file attachment. This is easy by using phpMailers functions AddEmbeddedImage and addAttachment, but some emails clients do not show pdf (file) attachment if I use AddEmbeddedImage before/after.. Images in the body must works in offline too (I can not use external links to show images in the email body)... Can somebody help? There is example of source code: <?php $mail = new phpmailer(); $mail->From = 'mail.mail@mailer.com'; $mail->Subject = 'PDF document'; $mail->IsHTML(true); $mail->AddAddress('someone@mail.com'); $mail->AddAttachment('document.pdf','document.pdf',"base64","application/pdf"); $mail->AddEmbeddedImage("logo.gif","weblogo","weblogo.gif","base64","image/gif"); $mail->Body = "<table><tr><td>Ahoj blabal</td><td><img src='cid:weblogo'></td></tr></table>"; $mail->Send(); ?> Quote Link to comment https://forums.phpfreaks.com/topic/115171-phpmailer-attachment-and-images-in-body-together-help-please/ 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.