1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-02 12:34:59 +02:00

ok, this should work now for mail() and smtpmail. We also removed the newline from the spacer for mail_encode due to php's mail() function choking up on subjects with newlines.

git-svn-id: file:///svn/phpbb/trunk@6574 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2006-11-12 18:44:42 +00:00
parent adea08faef
commit 85ddd3ea84

View File

@ -309,12 +309,15 @@ class messenger
$headers[] = 'X-MimeOLE: phpBB3';
$headers[] = 'X-phpBB-Origin: phpbb://' . str_replace(array('http://', 'https://'), array('', ''), generate_board_url());
// We use \n here instead of \r\n because our smtp mailer is adjusting it to \r\n automatically, whereby the php mail function only works
// if using \n.
if (sizeof($this->extra_headers))
{
$headers[] = implode("\r\n", $this->extra_headers);
$headers[] = implode("\n", $this->extra_headers);
}
return implode("\r\n", $headers);
return implode("\n", $headers);
}
/**
@ -752,7 +755,7 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $headers = '')
{
if (is_array($headers))
{
$headers = (sizeof($headers) > 1) ? join("\r\n", $headers) : $headers[0];
$headers = (sizeof($headers) > 1) ? join("\n", $headers) : $headers[0];
}
$headers = chop($headers);
@ -1379,9 +1382,7 @@ function mail_encode($str)
// define start delimimter, end delimiter and spacer
$end = '?=';
$start = '=?UTF-8?B?';
// It may sound strange, but within my tests using \n instead of \r\n seem to work better
$spacer = "$end\n $start";
$spacer = "$end $start";
// determine length of encoded text within chunks and ensure length is even
$length = 76 - strlen($start) - strlen($end);