I am facing an issue of using form input that I need to send as a text email and then put into the database.
When I send it as a text email, the newline characters show up as \\r\\n\\r\\n in the plain text email, but do not show up like that when stored in the DB.
I am using PHP/MySQL - what would be the fix to stop the \\r\\n\\r\\n characters from showing up in the email that gets sent out?
Thank you, Alex
A possible cause of this might be database sanitizing (like mysqli_real_escape_string). I've done the same mistake by systematically sanitizing even variables that were never passed to the database.
send the email as text/html and use
<p> or <br>
tags
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.