matvespa Posted February 8, 2010 Share Posted February 8, 2010 Hi. I am using 'tinymce' to create and send newsletter to my customer via email. The problem i face is that when i send the newsletter, only text can be seen and the image cant be seen at all. Please advise. Here is my email code: include("Mail.php"); include("Mail/mime.php"); $message = $_POST['elm2']; //the name of my tinymce textarea elm2 $text = "Text version of email"; $html = $message; $file = ""; $crlf = "\r\n"; $hdrs = array( "From" => "[email protected]", "Subject" => "Test mime message" ); $mime = new Mail_mime($crlf); $mime->setTXTBody($text); $mime->addHTMLImage ($file, "image/jpeg"); $mime->setHTMLBody($html); $body = $mime->get(); $hdrs = $mime->headers($hdrs); $mail =& Mail::factory("mail"); $mail->send("[email protected]", $hdrs, $body); ?> Link to comment https://forums.phpfreaks.com/topic/191315-embed-image-in-email-using-php/ Share on other sites More sharing options...
RussellReal Posted February 8, 2010 Share Posted February 8, 2010 you must set the content-type header to "text/html" Link to comment https://forums.phpfreaks.com/topic/191315-embed-image-in-email-using-php/#findComment-1008687 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.