diff --git a/app/code/local/Aschroder/SMTPPro/Model/Email.php b/app/code/local/Aschroder/SMTPPro/Model/Email.php index 575f755..d212e34 100644 --- a/app/code/local/Aschroder/SMTPPro/Model/Email.php +++ b/app/code/local/Aschroder/SMTPPro/Model/Email.php @@ -8,6 +8,7 @@ * @copyright Copyright (c) 2014 Ashley Schroder * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +require Mage::getBaseDir().'vendor/autoload.php'; class Aschroder_SMTPPro_Model_Email extends Mage_Core_Model_Email { @@ -32,9 +33,10 @@ public function send() { } else { $mail->setBodyText($this->getBody()); } + $idn = new \Mso\IdnaConvert\IdnaConvert(); $mail->setFrom($this->getFromEmail(), $this->getFromName()) - ->addTo($this->getToEmail(), $this->getToName()) + ->addTo($idn->encode($this->getToEmail()), $idn->encode($this->getToName())) ->setSubject($this->getSubject()); $transport = new Varien_Object(); // for observers to set if required diff --git a/app/code/local/Aschroder/SMTPPro/Model/Email/Queue.php b/app/code/local/Aschroder/SMTPPro/Model/Email/Queue.php index 8a2fe7b..528ee9e 100644 --- a/app/code/local/Aschroder/SMTPPro/Model/Email/Queue.php +++ b/app/code/local/Aschroder/SMTPPro/Model/Email/Queue.php @@ -1,5 +1,5 @@ getRecipients() as $recipient) { list($email, $name, $type) = $recipient; + $idn = new Mso\IdnaConvert\IdnaConvert(); + $email = $idn->encode($email); + switch ($type) { case self::EMAIL_TYPE_BCC: $mailer->addBcc($email, '=?utf-8?B?' . base64_encode($name) . '?=');