-
-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
69 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,19 +5,21 @@ | |
* http://www.magepal.com | [email protected] | ||
*/ | ||
|
||
namespace MagePal\GmailSmtpApp\Model\ZendMailTwo; | ||
namespace MagePal\GmailSmtpApp\Mail; | ||
|
||
use Exception; | ||
use Laminas\Mail\AddressList; | ||
use Laminas\Mail\Header\HeaderInterface; | ||
use Laminas\Mail\Message; | ||
use Laminas\Mail\Transport\Smtp as SmtpTransport; | ||
use Laminas\Mail\Transport\SmtpOptions; | ||
use Laminas\Mime\Mime; | ||
use Magento\Framework\Exception\MailException; | ||
use Magento\Framework\Mail\EmailMessageInterface; | ||
use Magento\Framework\Mail\MessageInterface; | ||
use Magento\Framework\Phrase; | ||
use MagePal\GmailSmtpApp\Helper\Data; | ||
use MagePal\GmailSmtpApp\Model\Store; | ||
use Zend\Mail\AddressList; | ||
use Zend\Mail\Message; | ||
use Zend\Mail\Transport\Smtp as SmtpTransport; | ||
use Zend\Mail\Transport\SmtpOptions; | ||
use Magento\Framework\Mail\EmailMessageInterface; | ||
|
||
/** | ||
* Class Smtp | ||
|
@@ -125,7 +127,7 @@ public function sendSmtpMessage( | |
|
||
foreach ($message->getHeaders()->toArray() as $headerKey => $headerValue) { | ||
$mailHeader = $message->getHeaders()->get($headerKey); | ||
if ($mailHeader instanceof \Zend\Mail\Header\HeaderInterface) { | ||
if ($mailHeader instanceof HeaderInterface) { | ||
$this->updateMailHeader($mailHeader); | ||
} elseif ($mailHeader instanceof \ArrayIterator) { | ||
foreach ($mailHeader as $header) { | ||
|
@@ -147,6 +149,7 @@ public function sendSmtpMessage( | |
} | ||
|
||
/** | ||
* | ||
* @param Message $message | ||
*/ | ||
protected function setSender($message) | ||
|
@@ -259,8 +262,8 @@ protected function getSmtpOptions() | |
*/ | ||
public function updateMailHeader($header) | ||
{ | ||
if ($header instanceof \Zend\Mail\Header\HeaderInterface) { | ||
if (\Zend\Mime\Mime::isPrintable($header->getFieldValue())) { | ||
if ($header instanceof HeaderInterface) { | ||
if (Mime::isPrintable($header->getFieldValue())) { | ||
$header->setEncoding('ASCII'); | ||
} else { | ||
$header->setEncoding('utf-8'); | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.