mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Removing Mime type notice.
It causes message delivery failures on some SMTP servers. Amazon SES suffers from this issue. Fixing failing tests caused by additional spaces in email address formatting. Fixes #2005
This commit is contained in:
parent
96a8d97de7
commit
0267a048f3
2 changed files with 2 additions and 5 deletions
|
@ -613,9 +613,6 @@ class EmailComponent extends Object{
|
|||
$this->_createBoundary();
|
||||
$headers['MIME-Version'] = '1.0';
|
||||
$headers['Content-Type'] = 'multipart/mixed; boundary="' . $this->__boundary . '"';
|
||||
$headers[] = 'This part of the E-mail should never be seen. If';
|
||||
$headers[] = 'you are reading this, consider upgrading your e-mail';
|
||||
$headers[] = 'client to a MIME-compatible client.';
|
||||
} elseif ($this->sendAs === 'text') {
|
||||
$headers['Content-Type'] = 'text/plain; charset=' . $this->charset;
|
||||
} elseif ($this->sendAs === 'html') {
|
||||
|
@ -781,7 +778,7 @@ class EmailComponent extends Object{
|
|||
}
|
||||
|
||||
if ($hasAlias && !empty($matches[2])) {
|
||||
return $this->_encode($matches[2]) . $this->_strip(' <' . $matches[3] . '>');
|
||||
return $this->_encode(trim($matches[2])) . $this->_strip(' <' . $matches[3] . '>');
|
||||
}
|
||||
return $this->_strip($string);
|
||||
}
|
||||
|
|
|
@ -1299,7 +1299,7 @@ HTMLBLOC;
|
|||
function testFormatAddressMultibyte() {
|
||||
$this->Controller->EmailTest->charset = 'UTF-8';
|
||||
$result = $this->Controller->EmailTest->formatAddress('ÄÖÜTest <email@domain.de>');
|
||||
$this->assertEqual($result, '=?UTF-8?B?w4TDlsOcVGVzdCA=?= <email@domain.de>');
|
||||
$this->assertEqual($result, '=?UTF-8?B?w4TDlsOcVGVzdA==?= <email@domain.de>');
|
||||
|
||||
$result = $this->Controller->EmailTest->formatAddress('ÄÖÜTest<email@domain.de>');
|
||||
$this->assertEqual($result, '=?UTF-8?B?w4TDlsOcVGVzdA==?= <email@domain.de>');
|
||||
|
|
Loading…
Add table
Reference in a new issue