title: How to send html emails php
body: <p>i am using following code in order to send html emails through php, please check my below code where i am doing wrong. its send emails but not in html format, i have tried so many examples avaiable on net but unable to get emails in html formats. please help me in this regard.</p>
  
  <pre><code> require_once "Mail.php";
   $name="Me";
   $mail_from="info@domain.com";
   $subject=$mail_from." Emails";
  
   $message = " 
   &lt;html&gt; 
    &lt;body bgcolor=#DDDDDD&gt; 
     YOUR HTML EMAIL
    &lt;/body&gt; 
   &lt;/html&gt; 
   "; 
  
  
   $From="from: $name &lt;$mail_from&gt;"; 
  
    $headers  = "From: $From\r\n"; 
    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  
  
    $to = "Shop &lt;info@domain.com&gt;";
  
    $from = "Contact $name &lt;info@domain.co.uk&gt;";
  
    $host = "mail.exclusivehosting.net";
    $username = "info@domain.co.uk";
    $password = "(hello)";
  
    $headers = array ('From' =&gt; $from,
    'To' =&gt; $to,
    'Subject' =&gt; $subject);
    $smtp = Mail::factory('smtp',
    array ('host' =&gt; $host,
    'auth' =&gt; true,
    'username' =&gt; $username,
    'password' =&gt; $password));
  
    $mail = $smtp-&gt;send($to, $headers, $message);
  
  
    if (PEAR::isError($mail)) {
    echo("&lt;p&gt;" . $mail-&gt;getMessage() . "&lt;/p&gt;");
    } else {
    //echo("&lt;p&gt;Message successfully sent!&lt;/p&gt;");
    echo'&lt;table width="800" border="0" align="center" &gt;
    &lt;td&gt;';
    echo "We've recived your contact information, we will get back soon!";
  echo'&lt;/td&gt;
  &lt;/table&gt;';
    }
  </code></pre>
  
  <p>as out i am getting following email</p>
  
  <pre><code>  &lt;html&gt; 
    &lt;body bgcolor=#DDDDDD&gt; 
    YOUR HTML EMAIL
    &lt;/body&gt; 
    &lt;/html&gt; 
  </code></pre>