I am using this function:
/**
* Send mail
*
* @param string $To Send email to
* @param string $From Send from
* @param string $Subject Email subject
* @param string $Body Email body
* @param string $Encoding Encoding to use
* @param string $Type Email type (html or plain)
* @return void
* @access public
*/
if (!function_exists("send_mail"))
{
function send_mail($To, $From, $Subject, $Body, $Encoding = "iso-8859-1", $TYPE = "plain")
{
$Headers = "From: " . $From . "\r\n";
$Headers .= "Reply-To: " . $From . "\r\n";
$Headers .= "Return-Path: " . $From . "\r\n";
$Headers .= "Content-Type: text/" . $TYPE . "; charset=" . $Encoding . "\r\n";
$Headers .= "X-mailer: ReekenX WForce Framework\r\n";
mail($To, $Subject, $Body, $Headers);
}
}
The solution I have found is to replace \r\n with only \n. In 6 servers, my mail sending was correct, but in one, mail headers was seen in message body. Like:
From: sender@sender.com Reply-to: sender@sender.com (other headers seen here) Message text
Can anybody explain why email sending with \r\n is bad, and with \n is right?
Sorry for my poor english :)


Sign In
Create Account


Back to top









