From be4b9fcd02e8677e63af75c3adf32cfc2b0def0b Mon Sep 17 00:00:00 2001 From: Juan Basso Date: Tue, 19 Apr 2011 21:47:48 -0400 Subject: [PATCH] The MIME version can be used in all types of e-mail. Fixes #14. --- lib/Cake/Network/CakeEmail.php | 2 +- lib/Cake/tests/Case/Network/CakeEmailTest.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Network/CakeEmail.php b/lib/Cake/Network/CakeEmail.php index 53b841e08..cb4345599 100644 --- a/lib/Cake/Network/CakeEmail.php +++ b/lib/Cake/Network/CakeEmail.php @@ -630,8 +630,8 @@ class CakeEmail { $headers['Subject'] = $this->_subject; } + $headers['MIME-Version'] = '1.0'; if (!empty($this->_attachments)) { - $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'; diff --git a/lib/Cake/tests/Case/Network/CakeEmailTest.php b/lib/Cake/tests/Case/Network/CakeEmailTest.php index 2750dc0de..cf79792ba 100644 --- a/lib/Cake/tests/Case/Network/CakeEmailTest.php +++ b/lib/Cake/tests/Case/Network/CakeEmailTest.php @@ -392,6 +392,7 @@ class CakeEmailTest extends CakeTestCase { 'X-Something' => 'nice', 'X-Mailer' => 'CakePHP Email Component', 'Date' => date(DATE_RFC2822), + 'MIME-Version' => '1.0', 'Content-Type' => 'text/plain; charset=UTF-8', 'Content-Transfer-Encoding' => '7bit' ); @@ -403,6 +404,7 @@ class CakeEmailTest extends CakeTestCase { 'X-Other' => 'cool', 'X-Mailer' => 'CakePHP Email Component', 'Date' => date(DATE_RFC2822), + 'MIME-Version' => '1.0', 'Content-Type' => 'text/plain; charset=UTF-8', 'Content-Transfer-Encoding' => '7bit' ); @@ -417,6 +419,7 @@ class CakeEmailTest extends CakeTestCase { 'X-Other' => 'cool', 'X-Mailer' => 'CakePHP Email Component', 'Date' => date(DATE_RFC2822), + 'MIME-Version' => '1.0', 'Content-Type' => 'text/plain; charset=UTF-8', 'Content-Transfer-Encoding' => '7bit' ); @@ -434,6 +437,7 @@ class CakeEmailTest extends CakeTestCase { 'X-Other' => 'cool', 'X-Mailer' => 'CakePHP Email Component', 'Date' => date(DATE_RFC2822), + 'MIME-Version' => '1.0', 'Content-Type' => 'text/plain; charset=UTF-8', 'Content-Transfer-Encoding' => '7bit' );