Line breaks in Emails
Posted 27 September 2006 - 06:12 PM
$email = "firstname.lastname@example.org";
$subject = "Hey";
$body = "Dear Person,\nHow are you?";
echo "<a href=\"mailto:$email?subject=$subject&body=$body\">";
Everything is working except my email client isn't recognizing the line break (\n). I tried html (<br />) as well and that didn't work. Any help is appreciated.
Posted 27 September 2006 - 06:42 PM
I tried that with no success. Here is the problem, since the string is enclosed by double quotes, it is interpreting the line breaks and carriage returns before it ever gets to the email client. So I think I want literal characters (single quotes) to be sent to the email client. This still doesn't work though because it shows up as \n in my email client. Thank you for your help.
Posted 27 September 2006 - 06:45 PM
Then it gets passed in your script without your knowledge. The way you can test this is; open the script in your IDE and just put some IDE line spacing where you would want the line break. If it works then you know what/where you problem is.
To fix it you'll need a different IDE or find the option in your IDE to turn off the auto line spacing.
President & Founder, MyCodeTree
email@example.com | http://mycodetree.com
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users