CodeIgniter Forums
HTML e-mails not sending in HTML - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: HTML e-mails not sending in HTML (/showthread.php?tid=29831)



HTML e-mails not sending in HTML - El Forum - 04-22-2010

[eluser]anndr0id[/eluser]
I haven't done much research on this, I searched the forums and found no similar problems. I wanted to ask in hopes that someone here has seen this before, or could give me a quick solution rather than me spending time testing/troubleshooting.

I've created an email.php file in the config and added the following line:
Code:
$config['mailtype'] = 'HTML';

I then set up my mail script in the controller:
Code:
$this->email->from('[email protected]', 'Notification');
$this->email->to($email);
$this->email->subject($subject);
$this->email->message($body);    
$this->email->send();
$data['email_error'] = $this->email->print_debugger();
$this->email->clear();

The e-mails are going out successfully, with all the content, however the e-mail I receive is in text and shows the HTML code.

Strangely, I also tried converting it back to text and entering "\n" for line breaks, and the "n"'s show up in the e-mail, however the backslashes disappear.

Any ideas as to what might be going on here? Possibly a missing config somewhere or maybe even an issue with the mail server?

Any help is greatly appreciated.

Thanks! Smile


HTML e-mails not sending in HTML - El Forum - 04-22-2010

[eluser]pickupman[/eluser]
You could try using a carriage return "\r\n";
Code:
$config['newline'] = '\r\n';