Page 1 of 1

format string in email

Posted: Wed Nov 18, 2009 7:58 am
by awelch
Hi,

I have the message body of an email with the variable below:

$message = $customername."&nbsp".$customeraddress."<br/>".$telnumber."<br/>".$faxnumber."<br/>".$email."<br/>".$emailinv."<br/>".$autsig."<br/>".$position."<br/>".$date."</body>"."</html>";

I want to format the output so that each variable is printed on the next line but in my email I can see the markup outputted.

Sorry this is an incredibly simple thing to ask. It is my first post though so be gentle!

Andy

Re: format string in email

Posted: Wed Nov 18, 2009 8:01 am
by iankent
If you're sending the email in plain text (which you are if you see <br /> instead of a newline), then simply replace all of the <br />'s with \n's, i.e.

Code: Select all

$message = $customername."&nbsp".$customeraddress."\n".$telnumber."\n".$faxnumber."\n".$email."\n".$emailinv."\n".$autsig."\n".$position."\n".$date;
hth