0

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);
dsm
  • 1
  • 1
  • 2

1 Answers1

0

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

jerebear
  • 6,503
  • 4
  • 31
  • 38