diff --git a/lib/Cake/Network/Email/MailTransport.php b/lib/Cake/Network/Email/MailTransport.php index c58d3087d95..3ad50f7f8ce 100644 --- a/lib/Cake/Network/Email/MailTransport.php +++ b/lib/Cake/Network/Email/MailTransport.php @@ -42,9 +42,10 @@ public function send(CakeEmail $email) { unset($headers['To']); $headers = $this->_headersToString($headers, $eol); $message = implode($eol, $email->message()); + $subject = str_replace(array("\r", "\n"), '', $email->subject()); $params = isset($this->_config['additionalParameters']) ? $this->_config['additionalParameters'] : null; - $this->_mail($to, $email->subject(), $message, $headers, $params); + $this->_mail($to, $subject, $message, $headers, $params); return array('headers' => $headers, 'message' => $message); } diff --git a/lib/Cake/Test/Case/Network/Email/MailTransportTest.php b/lib/Cake/Test/Case/Network/Email/MailTransportTest.php index c255ccd345d..98445dec5f3 100644 --- a/lib/Cake/Test/Case/Network/Email/MailTransportTest.php +++ b/lib/Cake/Test/Case/Network/Email/MailTransportTest.php @@ -69,7 +69,7 @@ public function testSendData() { $data .= "Content-Transfer-Encoding: 8bit"; $subject = '=?UTF-8?B?Rm/DuCBCw6VyIELDqXogRm/DuCBCw6VyIELDqXogRm/DuCBCw6VyIELDqXog?='; - $subject .= "\r\n" . ' =?UTF-8?B?Rm/DuCBCw6VyIELDqXo=?='; + $subject .= ' =?UTF-8?B?Rm/DuCBCw6VyIELDqXo=?='; $this->MailTransport->expects($this->once())->method('_mail') ->with( 'CakePHP ',