$Three3 Posted March 26, 2012 Share Posted March 26, 2012 I have a PHP contact form on my website. I have been using it for about a year now without any problems. Nothing has been updated on my website that has do to with the contact form. However, all of a sudden, when a user enters "line breaks" or "paragraphs" in the message box, when I receive the message, instead of having several paragraphs I have 1 long paragraph with "\r\n" in place of line breaks. Here is the code: $to = "info@mycompany123.com"; $headers = "From: $email"; $subject = $subject; $body = "Name: $name\n\n" . "Email: $email\n\n" . "Subject: $subject\n\n" . "Message: $message" ; mail ($to, $subject, $body, $headers) ; For example, if someone fills out my contact form, here is what it looks like in my inbox: Name: Allen Falcon Email: allen_falcon@example.com Subject: Help Message: Hello,\r\n I would like to know more about you guys program and how it works.\r\n Thanks,\r\n Allen Flacon I really do not know why it started doing this out of the blue but any help is greatly appreciated! Quote Link to comment https://forums.phpfreaks.com/topic/259739-php-contact-form-linebreak-issue/ Share on other sites More sharing options...
micah1701 Posted March 27, 2012 Share Posted March 27, 2012 if your code and mail server haven't changed, maybe its your e-mail client that changed and is now incorrectly displaying plain text line breaks. Have your tried looking at the e-mail in a different mail client? (ie, check it gmail, thunderbird, outlook, etc) otherwise, Quote Link to comment https://forums.phpfreaks.com/topic/259739-php-contact-form-linebreak-issue/#findComment-1331679 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.