\r\n should be between double quotes: "\r\n"
On Thu, Sep 24, 2009 at 3:52 PM, Adam Williams
> I have users enter support tickets into a a <textarea> form and then it
> emails it to me, I'm trying to get the emails to display when they hit enter
> correctly, so i'm changing the \r\n to <br>, but in the email i'm getting,
> its displaying the <br> instead of a line break: here is the code:
> $message = "<html><head><title>new support request
> Hello, ".$_SESSION["full_name"]." has created a new support request.
> Please log in at <a href=\"http://intra/helpdesk\">MDAH Helpdesk</a>. The
> problem request is \"";
> $message .= htmlspecialchars(str_replace('\r\n', '<br>',
> $message .= "\" and the best time to contact is
> \"".htmlspecialchars($_POST["contact_time"])."\" </p></body></html>";
> $headers = 'MIME-Version: 1.0' . "\r\n";
> $headers .= 'Content-type: text/html; charset=iso-8859-1' .
> $headers .= "From:
> ."\r\n" .
> "X-Mailer: PHP/" . phpversion();
> mail('isst...@mdah.state.ms.us', $subject, $message, $headers);
> but the email I get is:
> Hello, Karen Redhead has created a new support request. Please log in at
> MDAH Helpdesk <http://intra/helpdesk>. The problem request is "Elaine is out
> today but her computer no longer has Past Perfect from what I can tell. Also
> how does she access her email. The Sea Monkey email icon does not take you
> anywhere.<br>Thanks so much,<br>Karen" and the best time to contact is "1:30
> How come the email is being displayed with <br> instead of line breaks?
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php