[1.1 RC2] Sources/Subs-Post.php, function sendmail

Started by nwsw, February 03, 2006, 09:37:06 AM

Previous topic - Next topic

nwsw

Module: Sources/Subs-Post.php
Function: sendmail

The text format e-mail could be better with a MIME-Version header:


// Text is good too.
else
{
  $headers .= "MIME-Version: 1.0\r\n";
  $headers .= 'Content-Type: text/plain; charset=' . $charset . "\r\n";
  if ($encoding != '')
    $headers .= 'Content-Transfer-Encoding: ' . $encoding . "\r\n";
}


and then changing the SMTP function call to:


$mail_result = smtp_mail($to_array, $subject, $message, $headers);


I am also having better luck with the message body using only LF as a line separator when calling the built-in PHP mail function.

MIME Background:
Although RFC 1049 first created the Content-Type header, the format used by SMF for text e-mails is clearly intended to comply with the later MIME spec in RFC 2045, given its specific use of Content-Type:

Quote from: RFC2045
Messages composed in accordance with this document MUST include such a header field, with the following verbatim text:

MIME-Version: 1.0

...

Note that the MIME-Version header field is required at the top level of a message.

See also:


Advertisement: