Message Body of email is not showing up when email arrivesIn

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

Message Body of email is not showing up when email arrivesIn

Post by rdkurth »

Message Body of email is not showing up when email arrives

In my script the message is getting to the section in the code where is says $body = $hmessage; and $text_body = $message; But is not showing up in the email. The subject is there and all the email address are there. What is wrong with code ?

Code: Select all

// HTML body
    $body  = $hmessage;
    // Plain text body (for mail clients that cannot read HTML)
    $text_body  = $message;
 
$full_name=$this_row['firstname'] ." " . $this_row['lastname'];
//Create the message
$message =& new Swift_Message($subject);
$message->attach(new Swift_Message_Part($text_body));
$message->attach(new Swift_Message_Part($body, "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;}
Post Reply