0

I am trying to concatenate a php new line with variables, and, searching in Stack Overflow I found the vai to concatenate variables and put new line, so I have done this:

 $mail->Body = "<br />".$message."<br />"." - ".$email." -".$name;

But the email arrive like this:

<br />MessageOftheperson<br /> - example@gmail.com -NameOfThePerson

I would like it to be:

MessageOfThePerson
example@gmail.com -NameOfThePerson

How can I do this?

halfer
  • 19,824
  • 17
  • 99
  • 186
Catarina Nogueira
  • 1,024
  • 2
  • 12
  • 28

2 Answers2

3

The code you've written will do a newline in HTML.

You can use "\n".

ConstantD
  • 133
  • 1
  • 9
0

Always set content-type when sending HTML email

$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
Ankit Jain
  • 898
  • 7
  • 12