【问题标题】:magento email sending programmatically以编程方式发送magento电子邮件
【发布时间】:2018-04-12 13:14:55
【问题描述】:

我正在尝试使用以下代码发送恢复电子邮件。 但它从不发送电子邮件?有什么建议吗? 我使用的是 1.9 版本的 magento。

if ($customer->getId()) 
{
    try
    {
        $newResetPasswordLinkToken =  Mage::helper('customer')->generateResetPasswordLinkToken();
        $customer->changeResetPasswordLinkToken($newResetPasswordLinkToken);
        $customer->save();
        $customer->sendPasswordResetConfirmationEmail();
    }
    catch (Exception $exception) 
    {

    }
}

【问题讨论】:

  • 你有cron jobs enabled and configured吗?如果是,请运行 SELECT * FROM core_email_queue; 并查看您的电子邮件是否已添加到队列中。
  • 感谢您的建议,我已经安装了邮件服务器和cron。之后,它可以成功运行。但是现在我遇到了新的情况,发送的订单邮件没有从 core_email_queue 中清除。邮件被处理后肯定过了几天,但没有被删除。

标签: magento magento-1.9 reset-password


【解决方案1】:

我已经安装了 Postfix 邮件服务器。我用 crontab -e 添加了以下行 * * * * * sh /var/www/html/cron.sh 然后就可以正常使用了。

【讨论】:

    猜你喜欢
    • 2013-10-07
    • 1970-01-01
    • 2019-08-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多