views:

155

answers:

2

I'm sending out an email using CodeIgniter's built in library. All I'm trying to do is send a bolded string, but instead of rendering the tags, it is printing them. What I have:

<html>
 <head>
 </head>
 <body>
 <b>Donkey</b>
 </body>
 </html>

That is, character for character, the email I'm getting. Why aren't the tags rendering?

A: 

Have you tried

<span style='font-weight: bold'>My bold text</span>

OR

<strong>another bold tag</strong>

?

We use these and they both work for Gmail.

Glycerine
+5  A: 

From the documentation:

$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$config['mailtype'] = 'html';

$this->email->initialize($config);

The CodeIgniter Email class defaults to sending text emails. Unless you specify that the mailtype is HTML ($config['mailtype'] = 'html';) your html will be sent out as text.

Sean Vieira