I'm using the following to send an email:
<php .... $message = 'Hi '.$fname.', \r\n Your entries for the week of ' .$weekof.' have been reviewed. \r\n Please login and View Weekly reports to see the report and comments. \r\n Thanks, \r\n'.$myname; mail($to, $subject, $message, $from); ?>
When the message is received it does not start a new line at the "\r\n" but just prints them as part of the message.
I only tried it in Thunderbird 3, not any other clients.
`"<br>"`;
%0d%0a is the new line symbol of the email body in a mailto link.
In the most basic way you can Just press Ctrl + Enter when typing out the email, e.g. If you are needing something more complex, then you can Generate the email using a hidden HtmlText Box. If you are comfortable with HTML. You can then add a <br/> tag to allow a new line.
Try to change your '
to "
- php interprets a string inside single quotes as literals, whereas with quotes ("
) it will expand the \r\n
to what you want.
More information: http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.single
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With