php - How to avoid hardcoded newline from email body? -
i have application sends email next contents..
$message= "hi, some_content \n some_content_on_new_line". i want some_content_on_new_line on new line in email, when email sent, "\n" not interpolated newline character. instead displayed backslash followed 'n'. how can prevent this? email config.
mail($to, $subject, $message, $headers)
if \n showing in email content problem utilize of single quotes define string literal.
$message= 'hi, some_content \n some_content_on_new_line'; // show \n $message= "hi, some_content \n some_content_on_new_line"; // interpolate newline php email newline
No comments:
Post a Comment