Issue with html content-type header when sending an php smtp mail through PEAR

I can send emails perfectly but they are showing on plain text, I have been trying a lot of solutions to display it as HTML trying to put content-type but when I check the headers from the email sent MIME and Content-type headers are missing. What I am doing wrong?

Thank you!

$email = "example@test.com";

$subject = "example subject\r\n";

$msg_body = "example body with some html";

$host = "mail.examplehost.com";
     $username = "exampleemail@test.com";
     $password = "examplepass";

$smtp = Mail::factory('smtp',
   array ('host' => $host,
     'auth' => true,
     'username' => $username,
     'password' => $password));


$headers = array ('From' => "exampledomain.com",
          'To' => $to,
          'Subject' => $subject
          'MIME-Version' => "1.0",
          'Content-type' => "text/html; charset=iso-8859-1"
                   );

 $mail = $smtp->send($to,$headers,$msg_body);

Answers


In the headers array, you seem to be missing a comma after $subject


Need Your Help

Callback function is not executed

jquery post

The problem is that data is successfully transfered to the server, but the callback function is never executed in both versions:

Public-facing SharePoint 2007 portal - authentication question

sharepoint-2007 forms-authentication

I am involved in developing a portal with a public-facing side. For this i created a web application with windows authentication for intranet zone and after that, I created an extension for an inte...