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:
mark_story 2011-09-20 22:30:17 -04:00
parent 96a8d97de7
commit 0267a048f3
2 changed files with 2 additions and 5 deletions

View file

@ -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);
}

View file

@ -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>');