note 88302 modified in function.mail by danbrown

From: Date: Mon, 20 Jun 2011 15:08:21 +0000
Subject: note 88302 modified in function.mail by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-180712@lists.php.net to get a copy of this message
This is my solution of problems with Windows Mail on Vista. I got some of the headers in the mail body as plain text. When I removed '\r' and left just '\n' at the end of the two last lines of header it worked. This error didn't show up in my yahoo mail. <?php $body = "<html>\n"; $body .= "<body style=\"font-family:Verdana, Verdana, Geneva, sans-serif; font-size:12px; color:#666666;\">\n"; $body = $message; $body .= "</body>\n"; $body .= "</html>\n"; $headers = "From: My site<noreply@example.com>\r\n"; $headers .= "Reply-To: info@example.com\r\n"; $headers .= "Return-Path: info@example.com\r\n"; $headers .= "X-Mailer: Drupal\n"; $headers .= 'MIME-Version: 1.0' . "\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; return mail($recipient, $subject, $message, $headers); ?> --was-- This is my solution of problems with Windows Mail on Vista. I got some of the headers in the mail body as plain text. When I removed '\r' and left just '\n' at the end of the two last lines of header it worked. This error didn't show up in my yahoo mail. <?php $body = "<html>\n"; $body .= "<body style=\"font-family:Verdana, Verdana, Geneva, sans-serif; font-size:12px; color:#666666;\">\n"; $body = $message; $body .= "</body>\n"; $body .= "</html>\n"; $headers = "From: My site<noreply@my_site.com>\r\n"; $headers .= "Reply-To: info@my_site.com\r\n"; $headers .= "Return-Path: info@my_site.com\r\n"; $headers .= "X-Mailer: Drupal\n"; $headers .= 'MIME-Version: 1.0' . "\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; return mail($recipient, $subject, $message, $headers); ?> http://php.net/manual/en/function.mail.php

« previous php.notes (#180712) next »