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" => "youremail@domain.com", "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("xxx@mail.com", $hdrs, $body); ?> Quote 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" Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.