Welcome Guest, Not a member yet? Register   Sign In
linebreaks in text emails
#1

[eluser]stoefln[/eluser]
does anyone know how to do linebreaks in text emails? i tried \r and \n but looks like the "\" is removed. no linebreaks in my email...
#2

[eluser]stuffradio[/eluser]
I'm not sure if this works, but try
Code:
$string = 'Test
new line';
nl2br($string);
Wink
#3

[eluser]EvilivE[/eluser]
Code:
$msg = 'line one' . chr(10) . 'line two' . chr(10) . 'line three';
$this->email->send($msg);

HTH
#4

[eluser]dansmith65[/eluser]
I had this problem the other day too. I was using a view for the message, so the line breaks should have been coming from the line breaks in my view.

Turns out I had to set this config option: mailtype = text

The user guide says text is the default, but a text email wouldn't work for me unless I specifically set that option.

(using CI 2.0.0)




Theme © iAndrew 2016 - Forum software by © MyBB