Welcome Guest, Not a member yet? Register   Sign In
Send HTML as the message of the email.
#1

[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!
#2

[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.




Theme © iAndrew 2016 - Forum software by © MyBB