I've got the PHP mail(): function working for a form I'm using on my site. I am now trying to format the $body attribute to look nicer and more organized when I receive the subsequent e-mail.
I've tried \n and I've tried
and both give me
Here's the snippet of the code that I'm working with (I think it's just a matter of syntax that I'm doing wrong):
if(!empty($brandname) && !empty($firstname) && !empty($lastname) && !empty($email) && !empty($goals) && !empty($bio)){
$to = '[email protected]';
$subject = 'Submission Form';
$body = 'Brand Name: '.$brandname.'<br />Name: '.$firstname.' '.$lastname.'<br />Email: '.$email.'<br />About the Company:'.$bio;
$headers = 'From: '.$email;
It's just displayed the <br />
as text in the e-mail I receive. It was the same when I used \n (which I'm assuming is actually the right way to do it). What am I doing wrong? Thanks.
Answer: Use the Newline Characters ' \n ' or ' \r\n ' You can use the PHP newline characters \n or \r\n to create a new line inside the source code.
In your Send Outlook Mail Message activity you have selected the IsBodyHtml in the property as True, so you can use "<br />" tag where you need NewLine. This is a html tag for a new line.
The nl2br() function inserts HTML line breaks (<br> or <br />) in front of each newline (\n) in a string.
You can insert a break into plaintext emails using {! BR()} .
You must place \n
in double quotes "
not between single quotes '
If you want that this sequence would be interpreted as a new line (line feed 0x0A) character
Take a look at this php documentation:
http://php.net/manual/en/language.types.string.php
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