Skip to content

Commit

Permalink
Fixed sending BCC with DATA for CakeEmail, as well as 7->8bit convers…
Browse files Browse the repository at this point in the history
…ion tests passing
  • Loading branch information
predominant committed Oct 22, 2011
1 parent f8697cc commit 2844f4a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Cake/Network/Email/SmtpTransport.php
Expand Up @@ -165,7 +165,7 @@ protected function _sendRcpt() {
protected function _sendData() {
$this->_smtpSend('DATA', '354');

$headers = $this->_cakeEmail->getHeaders(array('from', 'sender', 'replyTo', 'readReceipt', 'returnPath', 'to', 'cc', 'bcc', 'subject'));
$headers = $this->_cakeEmail->getHeaders(array('from', 'sender', 'replyTo', 'readReceipt', 'returnPath', 'to', 'cc', 'subject'));
$headers = $this->_headersToString($headers);
$message = implode("\r\n", $this->_cakeEmail->message());
$this->_smtpSend($headers . "\r\n\r\n" . $message . "\r\n\r\n\r\n.");
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php
Expand Up @@ -224,14 +224,14 @@ public function testSendData() {
$data = "From: CakePHP Test <noreply@cakephp.org>\r\n";
$data .= "To: CakePHP <cake@cakephp.org>\r\n";
$data .= "Cc: Mark Story <mark@cakephp.org>, Juan Basso <juan@cakephp.org>\r\n";
$data .= "Bcc: phpnut@cakephp.org\r\n";
//$data .= "Bcc: phpnut@cakephp.org\r\n";

This comment has been minimized.

Copy link
@markstory

markstory Oct 22, 2011

Member

Why not just remove the line?

This comment has been minimized.

Copy link
@ceeram

ceeram Oct 22, 2011

Contributor

it is in next commit

This comment has been minimized.

Copy link
@predominant

predominant Oct 22, 2011

Author Contributor

Its my friend.

$data .= "X-Mailer: CakePHP Email\r\n";
$data .= "Date: " . date(DATE_RFC2822) . "\r\n";
$data .= "Message-ID: <4d9946cf-0a44-4907-88fe-1d0ccbdd56cb@localhost>\r\n";
$data .= "Subject: Testing SMTP\r\n";
$data .= "MIME-Version: 1.0\r\n";
$data .= "Content-Type: text/plain; charset=UTF-8\r\n";
$data .= "Content-Transfer-Encoding: 7bit\r\n";
$data .= "Content-Transfer-Encoding: 8bit\r\n";
$data .= "\r\n";
$data .= "First Line\r\n";
$data .= "Second Line\r\n";
Expand Down

0 comments on commit 2844f4a

Please sign in to comment.