What is the difference between using '\n' and "\n" for line breaks in PHP mail function?
Using '\n' in PHP mail function will not work as expected because single quotes do not interpret escape sequences like '\n'. To create a line break in the message body of the email, you should use "\n" with double quotes so that the escape sequence is processed correctly.
// Incorrect way using '\n'
$message = "Hello, this is line 1\nThis is line 2";
// Correct way using "\n"
$message = "Hello, this is line 1" . "\n" . "This is line 2";