Trying to get new line on sms message sent from php script

Matt picture Matt · Aug 18, 2010 · Viewed 48.7k times · Source

I've been trying to get a new line generated in my SMS message sent from a PHP script. I've used \r\n, <BR> and some hex codes. No matter what I do the message comes to my phone without line breaks.

$body .= 'City:'.$venue.'\r\n'; //<- doesn't work
$body .= 'State:'.$state.'<br>'; //<- doesn't work

This is my header type...(complete header not included)

$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

I use mail to send...

mail($somenumber,$subject,$body,$headers)

Everything works fine in the sense that I receive the message. I hope that I'm missing something, because this is driving me crazy.

Answer

Nasser Al-Wohaibi picture Nasser Al-Wohaibi · Sep 19, 2012

Use: %0a, worked for me in Nokia and Android