Magento Zend_Mail_Protocol_Exception:无法通过TLS连接

时间:2018-01-03 11:04:20

标签: php email magento cron

在Magento 1.9.1版上我使用自定义模块,我需要通过cron发送邮件。 我也在使用Aschroder SMTP Extension。 邮件发送测试在Magento Aschroder扩展中正常工作。 服务器设置:

mail.mydomain.com
port:587
security:TLS
authentication:plain

相关的模块代码就像

public function sendExpiryNotification()
    {

        $mail = Mage::getModel('core/email')
     ->setToEmail('mytest mail id')
     ->setBody('Body of the Automated Cron Email Goes Here')
     ->setSubject('Subject: Cron Task  '.date("Y-m-d H:i:s"))
     ->setFromEmail('sender id')
     ->setFromName('Store name')
     ->setType('html');

    $mail->send();
  }

现在,当我从命令行手动运行cron.php时: 我在Magento数据库中记录了这些玉米错误:

Zend_Mail_Protocol_Exception: Unable to connect via TLS in /var/www/clients/client2/web200/web/lib/Zend/Mail/Protocol/Smtp.php:213
Stack trace:
#0 /var/www/clients/client2/web200/web/lib/Zend/Mail/Transport/Smtp.php(200): Zend_Mail_Protocol_Smtp->helo('localhost')
#1 /var/www/clients/client2/web200/web/lib/Zend/Mail/Transport/Abstract.php(348): Zend_Mail_Transport_Smtp->_sendMail()
#2 /var/www/clients/client2/web200/web/lib/Zend/Mail.php(1194): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
#3 /var/www/clients/client2/web200/web/app/code/local/Aschroder/SMTPPro/Model/Email.php(48): Zend_Mail->send(Object(Zend_Mail_Transport_Smtp))
#4 /var/www/clients/client2/web200/web/app/code/community/Meanbee/VIPMembership/Model/Observer.php(249): Aschroder_SMTPPro_Model_Email->send()
#5 /var/www/clients/client2/web200/web/app/code/core/Mage/Cron/Model/Observer.php(325): Meanbee_VIPMembership_Model_Observer->sendExpiryNotification(Object(Mage_Cron_Model_Schedule))
#6 /var/www/clients/client2/web200/web/app/code/core/Mage/Cron/Model/Observer.php(72): Mage_Cron_Model_Observer->_processJob(Object(Mage_Cron_Model_Schedule), Object(Mage_Core_Model_Config_Element))
#7 /var/www/clients/client2/web200/web/app/code/core/Mage/Core/Model/App.php(1338): Mage_Cron_Model_Observer->dispatch(Object(Varien_Event_Observer))
#8 /var/www/clients/client2/web200/web/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Cron_Model_Observer), 'dispatch', Object(Varien_Event_Observer))
#9 /var/www/clients/client2/web200/web/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('default', Array)
#10 /var/www/clients/client2/web200/web/cron.php(76): Mage::dispatchEvent('default')
#11 {main}

和我的服务器mail.log

Jan  3 16:20:08 server2 postfix/submission/smtpd[23306]: lost connection after STARTTLS from server2.mywebsolutions.co.in[69.197.135.186]
Jan  3 16:20:08 server2 postfix/submission/smtpd[23306]: disconnect from server2.mywebsolutions.co.in[69.197.135.186] ehlo=1 starttls=1 commands=2

在这里需要帮助解决我的错误。

0 个答案:

没有答案