CodeIgniter Forums
Send HTML as the message of the email. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: Send HTML as the message of the email. (/thread-33180.html)



Send HTML as the message of the email. - El Forum - 08-18-2010

[eluser]chengfeng[/eluser]
I am learning to send the email. If the message is a simple text, it is ok. But when I send the message as HTML, It displays the HTML code.

Code:
$msg="<table>
         <tr><th>Firstname</th><th>Lastname</th></tr>
         <tr><td>John</td><td>Doe</td></tr>
      </table>";
$this->email->from('[email protected]', 'Chen');
$this->email->to('[email protected]');
$this->email->subject('Email Test');
$this->email->message($msg);
$this->email->send();

Thanks for helping me!


Send HTML as the message of the email. - El Forum - 08-18-2010

[eluser]mddd[/eluser]
1: Have you set the email library to use html email?
2: If you send html email you should put in a complete html page. From &lt;html&gt; to &lt;/html&gt; tag, including head and body.

Also: Are you using actual email addresses in your example code? Seems like a bad idea.