Question : Preparing email output in PHP script

I'm trying to use my limited PHP skills to create an output from a PHP script for the body part of an email message. Want the email format to be text/plain to make it readable for everyone.

Creating and sending the email is ok. My problem is to put data from some of my arrays and variables into the message body. Already have a $Body variable where I've put some plain text. Challenge is to get info from my variables into the $Body.

Script is tested with output via echo and works fine.

Depending on a few factors, I need to put different variables into the $emailmsg that in turn will be part of my message body. Part of code enclosed. Have added // Note to mark problem areas.

Thanks for any help!

Answer : Preparing email output in PHP script

In a plain text email, '<br />' doesn't work.  You need to replace that with "\r\n".  Note the double quotes.  They are required to use the escape sequences for cr-lf.

And this: ." "\n" " won't work right.  You don't need the extra double quotes, just use \r\n in the string since it is already a double quoted string.

http://us.php.net/manual/en/language.types.string.php
Random Solutions  
 
programming4us programming4us