how to use new line breaks with phpmailer for text only emails
February 16, 2010
1 comment
I have been trying to add new line breaks to text only emails with \n\n.
I discovered that it will only work when using double quotes (“) for the body string.
When using single quotes (‘) \n\n will show in emails as such.
This is because PHP interprets single and double quotes in a different manner.
As stated in the PHP String Manual:
“Unlike the double-quoted and heredoc syntaxes, variables and escape sequences for special characters will NOT be expanded when they occur in single quoted strings.”
Comments
Leave a comment Trackback