Permalink
Browse files

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
  • Loading branch information...
1 parent 96a8d97 commit 0267a048f311935029647a3664f1501b2659c92d @markstory markstory committed Sep 21, 2011
@@ -613,9 +613,6 @@ function _createHeader() {
$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 @@ function _formatAddress($string, $smtp = false) {
}
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 @@ function testFormatAddressAliases() {
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>');

0 comments on commit 0267a04

Please sign in to comment.