Problem with multipart will not sent HTML message

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
rdkurth
Forum Newbie
Posts: 3
Joined: Sat Feb 02, 2008 1:10 pm

Problem with multipart will not sent HTML message

Post by rdkurth »

Only the text message shows up but not the html part of the message.
I have looked threw the forum and in the docs but can not seam to get this to work.Using php5 version

Code: Select all

 
// HTML body
$swiftHtml =$hmessage; 
// Plain text body (for mail clients that cannot read HTML)
$swiftPlain = $message; 
$full_name=$this_row['firstname'] ." " . $this_row['lastname'];
//Create the message
$message = new Swift_Message($subject);
$message->attach(new Swift_Message_Part($swiftPlain));
$message->attach(new Swift_Message_Part($swiftHtml, "text/html"));
$message->setReturnPath($MailAddReplyTo);
$message->setReplyTo($MailFrom,$MailFromName);
//Now check if Swift actually sends it
if ($swift->send($message, $this_row['emailaddress'],$MailFrom,$MailFromName)) 
{echo "Sent";}else{ echo "Failed"; exit;}
rdkurth
Forum Newbie
Posts: 3
Joined: Sat Feb 02, 2008 1:10 pm

Re: Problem with multipart will not sent HTML message

Post by rdkurth »

I figured it out the problem was in my HTML Document
Post Reply