Page 1 of 1

Problem Emailing HTML

Posted: Mon Feb 16, 2009 4:59 pm
by gamak
Hello

I'm having a problem emailing HTML content. I'm getting message data from a PHP form. When ever the stuff is sent through email, it doesnt display in HTML, but instead shows all the HTML tags in the email, Like below.

<P>Hi <<FIRST Name>>,<BR><BR>Hey <STRONG>boss</STRONG> what have you <FONT face="Comic Sans MS" size=3>been</FONT> up to? &nbsp;</P>


Any ideas?

Code: Select all

 
$swift =& new Swift(new Swift_Connection_SMTP("localhost"));
                    $message =& new Swift_Message("$temp_sub");
                    $message->attach(new Swift_Message_Part($tmp_msg));
                    $message->attach(new Swift_Message_Part("$tmp_msg", "text/html"));
                    $email_address = $_SESSION['email_array'][$_SESSION['email_count']][$i]; 
                     
                    if ($swift->send($message, new Swift_Address($email_address, $temp_sub), new Swift_Address($temp_from)))                    
                    {
 

Re: Problem Emailing HTML

Posted: Mon Feb 16, 2009 7:42 pm
by Chris Corbyn
It looks like you're adding the same content to the HTML and plain text parts. Does $tmp_msg contain HTML?

The plain text part must contain plain text.