How to send an HTML email using SMTP in PHP

后端 未结 6 1616
醉梦人生
醉梦人生 2021-01-14 19:56

I\'ve been able to send an email using SMTP in PHP, but when I try to change the Content Type to HTML, the email doesn\'t get delivered. This is the code I\'m trying to use:

6条回答
  •  梦毁少年i
    2021-01-14 21:03

    Write content type in a first line of header just like this

    $to = ""; $headers = array ('Content-Type' => "text/html; charset=ISO-8859-1", 'From' => $from, 'To' => $to, 'Subject' => $subject, 'MIME-Version' => '1.0' ); 
    

    This is working for me..

提交回复
热议问题