Skip to content

Commit

Permalink
Renamed the default X-Mailer value.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbasso committed Apr 23, 2011
1 parent 636b480 commit 6a7b42f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/Cake/Controller/Component/EmailComponent.php
Expand Up @@ -333,7 +333,7 @@ public function send($content = null, $template = null, $layout = null) {

$lib->subject($this->subject)->messageID($this->messageId);

$headers = array();
$headers = array('X-Mailer' => $this->xMailer);
foreach ($this->headers as $key => $value) {
$headers['X-' . $key] = $value;
}
Expand Down
6 changes: 2 additions & 4 deletions lib/Cake/Network/CakeEmail.php
Expand Up @@ -32,11 +32,11 @@
*/
class CakeEmail {
/**
* What mailer should EmailComponent identify itself as
* Default X-Mailer
*
* @constant EMAIL_CLIENT
*/
const EMAIL_CLIENT = 'CakePHP Email Component';
const EMAIL_CLIENT = 'CakePHP Email';

/**
* Line length - no should more - RFC 2822 - 2.1.1
Expand Down Expand Up @@ -943,9 +943,7 @@ public function send($content = null) {

if (!empty($this->_attachments)) {
$this->_attachFiles();
}

if (!empty($this->_attachments)) {
$this->_message[] = '';
$this->_message[] = '--' . $this->_boundary . '--';
$this->_message[] = '';
Expand Down
8 changes: 4 additions & 4 deletions lib/Cake/tests/Case/Network/CakeEmailTest.php
Expand Up @@ -390,7 +390,7 @@ public function testHeaders() {
$this->CakeEmail->setHeaders(array('X-Something' => 'nice'));
$expected = array(
'X-Something' => 'nice',
'X-Mailer' => 'CakePHP Email Component',
'X-Mailer' => 'CakePHP Email',
'Date' => date(DATE_RFC2822),
'MIME-Version' => '1.0',
'Content-Type' => 'text/plain; charset=UTF-8',
Expand All @@ -402,7 +402,7 @@ public function testHeaders() {
$expected = array(
'X-Something' => 'very nice',
'X-Other' => 'cool',
'X-Mailer' => 'CakePHP Email Component',
'X-Mailer' => 'CakePHP Email',
'Date' => date(DATE_RFC2822),
'MIME-Version' => '1.0',
'Content-Type' => 'text/plain; charset=UTF-8',
Expand All @@ -417,7 +417,7 @@ public function testHeaders() {
'From' => 'cake@cakephp.org',
'X-Something' => 'very nice',
'X-Other' => 'cool',
'X-Mailer' => 'CakePHP Email Component',
'X-Mailer' => 'CakePHP Email',
'Date' => date(DATE_RFC2822),
'MIME-Version' => '1.0',
'Content-Type' => 'text/plain; charset=UTF-8',
Expand All @@ -435,7 +435,7 @@ public function testHeaders() {
'To' => 'cake@cakephp.org, CakePHP <php@cakephp.org>',
'X-Something' => 'very nice',
'X-Other' => 'cool',
'X-Mailer' => 'CakePHP Email Component',
'X-Mailer' => 'CakePHP Email',
'Date' => date(DATE_RFC2822),
'MIME-Version' => '1.0',
'Content-Type' => 'text/plain; charset=UTF-8',
Expand Down

0 comments on commit 6a7b42f

Please sign in to comment.