我有一个magento安装https://ashoo.com.au ...一切正常,但是当客户下订单时,电子邮件不会发送给客户,而不是发送给管理员电子邮件......但订单存在于magento admin中。 ..我在互联网上搜索过..以下是我通过cpanel尝试过的一些事情......
1. curl -s -o /dev/null https://ashoo.com.au/cron.php
2. php https://ashoo.com.au/cron.php
3. /home/ashoo/public_html/cron.ssh
我把时间分为每分钟1次,每分钟5次
Cron Job运行但没有电子邮件......任何帮助都将不胜感激
注意: php邮件功能在我的服务器上工作得很好..所以我测试了发送邮件的那个
答案 0 :(得分:0)
好的,我已经通过在OnepageController.php的successAction()方法中添加代码来解决这个问题
$sql = "SELECT * FROM core_email_queue_recipients INNER JOIN core_email_queue ON core_email_queue.message_id = core_email_queue_recipients.message_id WHERE event_type = 'new_order' ORDER BY core_email_queue.message_id DESC LIMIT 2";
$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
foreach ($connection->fetchAll($sql) as $arr_row) {
$message_body = $arr_row['message_body'];
$recipient_email = $arr_row['recipient_email'];
$message_parameters = $arr_row['message_parameters'];
$message_parameters = unserialize($message_parameters);
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
// More headers
$headers .= 'From: '.$message_parameters['from_name'].'<'.$message_parameters['from_email'].'>' . "\r\n";
// $headers .= 'Cc: myboss@example.com' . "\r\n";
mail($recipient_email, $message_parameters['subject'], $message_body, $headers);
}
现在它正在发送新订单的电子邮件