diff --git a/Mail/Rse/Mail.php b/Mail/Rse/Mail.php index 5f01a12..7cdb523 100644 --- a/Mail/Rse/Mail.php +++ b/Mail/Rse/Mail.php @@ -21,6 +21,7 @@ namespace Mageplaza\Smtp\Mail\Rse; +use Magento\Store\Model\StoreManagerInterface; use Mageplaza\Smtp\Helper\Data; use Laminas\Mail\Message; use Laminas\Mail\Transport\Smtp; @@ -38,6 +39,11 @@ class Mail */ protected $smtpHelper; + /** + * @var StoreManagerInterface + */ + protected $_storeManager; + /** * @var array Is module enable by store */ @@ -82,10 +88,12 @@ class Mail * Mail constructor. * * @param Data $helper + * @param StoreManagerInterface $storeManager */ - public function __construct(Data $helper) + public function __construct(Data $helper, StoreManagerInterface $storeManager) { $this->smtpHelper = $helper; + $this->_storeManager = $storeManager; } /** @@ -168,7 +176,8 @@ public function getTransport($storeId) unset($options['ssl']); } unset($options['type']); - + $options['name'] = parse_url($this->_storeManager->getStore()->getBaseUrl(), PHP_URL_HOST); + $options = new SmtpOptions($options); $this->_transport = new Smtp($options);