1

What should I add to the folowing code in order to send HTML mail?

$headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject);

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

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

Thanks

templatetypedef
  • 362,284
  • 104
  • 897
  • 1,065
Mihai
  • 31
  • 1
  • 3
  • Which mail class is it? What isn't working? And since your code seems to be [an excerpt from the standard example](http://stackoverflow.com/questions/712392/send-email-using-gmail-smtp-server-from-php-page) - what did you try so far? – mario Jan 30 '11 at 09:42

1 Answers1

2

Don't you need to specify the content type of the mail? And BTW, what are you using for sending mail?

Try something like :

$headers = array("MIME-Version"=> '1.0', 
                 "Content-type" => "text/html; charset=iso-8859-1",
                 "From" => $from,
                 "To" => $to, 
                 "Subject" => $subject);
Damien Pirsy
  • 25,319
  • 8
  • 70
  • 77