title: Codeigniter Html Email Display HTML Source Code
body: <p>Try To Send email But It Mailed Format is HTML Source Code.
  Here is mY Controller-</p>
  
  <pre><code>$config = Array(        
          'protocol' =&gt; 'SMTP',
          'smtp_host' =&gt; 'hostname',
          'smtp_port' =&gt; 'portname',
          'smtp_user' =&gt; 'abn@gmail.com',
          'smtp_pass' =&gt; '***',
          'smtp_timeout' =&gt; '4',
          'mailtype'  =&gt; 'html',
          'charset'   =&gt; 'utf-8'
      );
      $this-&gt;load-&gt;library('email', $config);
      $this-&gt;email-&gt;set_newline("\r\n");
  
      $this-&gt;email-&gt;from('devendra@gmail.com', 'ABC');
      $data = array(
           'userName'=&gt; $this-&gt;input-&gt;post('email'),
           'password'=&gt; $this-&gt;input-&gt;post('password'),
           'EmpName'=&gt; $this-&gt;input-&gt;post('name'),
           'Number'=&gt; $this-&gt;input-&gt;post('number'),
           'City'=&gt; $this-&gt;input-&gt;post('city'),
           'State'=&gt; $this-&gt;input-&gt;post('email'),
           'Address'=&gt; $this-&gt;input-&gt;post('address')
               );
      $this-&gt;email-&gt;to($this-&gt;input-&gt;post('email')); 
      $Subject = 'User Login Details';
      $this-&gt;email-&gt;subject($Subject); 
  
      $body = $this-&gt;load-&gt;view('mailFormat.php',$data,TRUE);
      $this-&gt;email-&gt;message($body);   
      $this-&gt;email-&gt;send();
  </code></pre>
  
  <p>and Email Format Page mailFormat.php</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8" /&gt;
  &lt;title&gt;Employee Registration&lt;/title&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div&gt;
   &lt;div style="font-size: 26px;font-weight: 700;letter-spacing: -0.02em;line-height: 32px;color: #41637e;font-family: sans-serif;text-align: center" align="center" id="emb-email-header"&gt;&lt;img style="border: 0;-ms-interpolation-mode: bicubic;display: block;Margin-left: auto;Margin-right: auto;max-width: 152px" src="&lt;?php echo base_url(); ?&gt;/images/logo.png" alt="WFT" width="152" height="108"&gt;&lt;/div&gt;
  
   &lt;p style="Margin-top: 0;color: #565656;font-family: Georgia,serif;font-size: 16px;line-height: 25px;Margin-bottom: 25px"&gt;Hey  &lt;?php echo $EmpName;?&gt;,&lt;/p&gt; 
  &lt;p&gt;Email Id - &lt;?php echo $userName; ?&gt; &lt;/p&gt;
  &lt;p&gt;Password - &lt;?php echo $password; ?&gt; &lt;/p&gt;
  &lt;p&gt;Contact Number - &lt;?php echo $Number; ?&gt; &lt;/p&gt;
  &lt;p&gt;City - &lt;?php echo $City; ?&gt; &lt;/p&gt;
  &lt;p&gt;State - &lt;?php echo $State; ?&gt; &lt;/p&gt;
  &lt;p&gt;Address - &lt;?php echo $Address; ?&gt; &lt;/p&gt;
  
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Email Sent. but The Format of email Showing HTML Source Code. How to Change it To HTML format email. </p>