Renamed the default X-Mailer value.

This commit is contained in:
Juan Basso 2011-04-22 22:41:52 -04:00
parent 636b48024d
commit 6a7b42f1eb
3 changed files with 7 additions and 9 deletions

View file

@ -333,7 +333,7 @@ class EmailComponent extends Component {
$lib->subject($this->subject)->messageID($this->messageId); $lib->subject($this->subject)->messageID($this->messageId);
$headers = array(); $headers = array('X-Mailer' => $this->xMailer);
foreach ($this->headers as $key => $value) { foreach ($this->headers as $key => $value) {
$headers['X-' . $key] = $value; $headers['X-' . $key] = $value;
} }

View file

@ -32,11 +32,11 @@ App::uses('View', 'View');
*/ */
class CakeEmail { class CakeEmail {
/** /**
* What mailer should EmailComponent identify itself as * Default X-Mailer
* *
* @constant EMAIL_CLIENT * @constant EMAIL_CLIENT
*/ */
const EMAIL_CLIENT = 'CakePHP Email Component'; const EMAIL_CLIENT = 'CakePHP Email';
/** /**
* Line length - no should more - RFC 2822 - 2.1.1 * Line length - no should more - RFC 2822 - 2.1.1
@ -943,9 +943,7 @@ class CakeEmail {
if (!empty($this->_attachments)) { if (!empty($this->_attachments)) {
$this->_attachFiles(); $this->_attachFiles();
}
if (!empty($this->_attachments)) {
$this->_message[] = ''; $this->_message[] = '';
$this->_message[] = '--' . $this->_boundary . '--'; $this->_message[] = '--' . $this->_boundary . '--';
$this->_message[] = ''; $this->_message[] = '';

View file

@ -390,7 +390,7 @@ class CakeEmailTest extends CakeTestCase {
$this->CakeEmail->setHeaders(array('X-Something' => 'nice')); $this->CakeEmail->setHeaders(array('X-Something' => 'nice'));
$expected = array( $expected = array(
'X-Something' => 'nice', 'X-Something' => 'nice',
'X-Mailer' => 'CakePHP Email Component', 'X-Mailer' => 'CakePHP Email',
'Date' => date(DATE_RFC2822), 'Date' => date(DATE_RFC2822),
'MIME-Version' => '1.0', 'MIME-Version' => '1.0',
'Content-Type' => 'text/plain; charset=UTF-8', 'Content-Type' => 'text/plain; charset=UTF-8',
@ -402,7 +402,7 @@ class CakeEmailTest extends CakeTestCase {
$expected = array( $expected = array(
'X-Something' => 'very nice', 'X-Something' => 'very nice',
'X-Other' => 'cool', 'X-Other' => 'cool',
'X-Mailer' => 'CakePHP Email Component', 'X-Mailer' => 'CakePHP Email',
'Date' => date(DATE_RFC2822), 'Date' => date(DATE_RFC2822),
'MIME-Version' => '1.0', 'MIME-Version' => '1.0',
'Content-Type' => 'text/plain; charset=UTF-8', 'Content-Type' => 'text/plain; charset=UTF-8',
@ -417,7 +417,7 @@ class CakeEmailTest extends CakeTestCase {
'From' => 'cake@cakephp.org', 'From' => 'cake@cakephp.org',
'X-Something' => 'very nice', 'X-Something' => 'very nice',
'X-Other' => 'cool', 'X-Other' => 'cool',
'X-Mailer' => 'CakePHP Email Component', 'X-Mailer' => 'CakePHP Email',
'Date' => date(DATE_RFC2822), 'Date' => date(DATE_RFC2822),
'MIME-Version' => '1.0', 'MIME-Version' => '1.0',
'Content-Type' => 'text/plain; charset=UTF-8', 'Content-Type' => 'text/plain; charset=UTF-8',
@ -435,7 +435,7 @@ class CakeEmailTest extends CakeTestCase {
'To' => 'cake@cakephp.org, CakePHP <php@cakephp.org>', 'To' => 'cake@cakephp.org, CakePHP <php@cakephp.org>',
'X-Something' => 'very nice', 'X-Something' => 'very nice',
'X-Other' => 'cool', 'X-Other' => 'cool',
'X-Mailer' => 'CakePHP Email Component', 'X-Mailer' => 'CakePHP Email',
'Date' => date(DATE_RFC2822), 'Date' => date(DATE_RFC2822),
'MIME-Version' => '1.0', 'MIME-Version' => '1.0',
'Content-Type' => 'text/plain; charset=UTF-8', 'Content-Type' => 'text/plain; charset=UTF-8',