Re: Line breaks in mail function?
| From: | Murray @ PlanetThoughtful | Date: | Mon, 07 Nov 2005 03:35:54 +0000 |
| Subject: | Re: Line breaks in mail function? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-225218@lists.php.net to get a copy of this message | ||
Jasper Bryant-Greene wrote:
On Mon, 2005-11-07 at 12:20 +1000, Murray @ PlanetThoughtful wrote:Don't you hate it when you've been staring at code too long to notice the obvious? Thank you! Much warmth, MurrayExample code: $body = 'From: ' . $name . '\r\n\r\n'; $body .= 'Email:' . $email . '\r\n\r\n'; $body .= 'IP Address: ' . $_SERVER['REMOTE_ADDR'] . '\r\n\r\n'; $body .= 'Feedback:\r\n\r\n'; $body .= $feedback; mail("planetthoughtful@gmail.com", "Feedback", $body, "From: $email\r\nReply-To: $email\r\nX-Mailer: PHP/" . phpversion()); As I said above, I've also tried using "\n\n" instead of "\r\n\r\n". Can anyone give me some advive on how to get the linebreak characters interpreted as linebreaks?Use double quotes around the parts that have \r and \n characters if you want them to be interpreted. Ah, damn you Jasper, I should have noticed that myself.