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;}