简体   繁体   中英

cron is working but not sending emails in magento

I am running my website on magento 1.9.2 and Ultimo theme. Everything was quite fine but today i came to know that transactional emails are not been sent and i started to figure out. I have intstalled AOE Schedular and before it was giving me an error that no heart beat found. but then i read some blogs and made some changes and now its working but still not sending emails. The strange thing is, in que list it shows that before it was successful and i was also receiving all the orders emails but only since yesterday it sopped. Below is screen shot. screen shot

i have checked every possibilities, as i have another website also on same server and the cron settings are also the same as for other website. 0/5 ****

please help me as my clients are complaining me that they are not getting any confirmation email.

There are two ways to work on email sending.

First, Setup Cron job

Step-1 : First Login to admin panel.

Step-2 : Go to admin menu "System > Configuration > Advanced > System > Cron".

First of all, confirm that you have set up Cron tasks in the Magento admin.

For help to setup Cron see the Url : http://www.magikcommerce.com/blog/how-to-setup-a-cron-job-in-magento-magento-cron-tutorial/

Step-3 : Find the cron.php file at Magento root directory and set the cron job run every 5 minutes.

Second, transactional emails will be sent instantly.

Step-1 : find order.php app/code/core/Mage/Sales/Model/Order.php near line no. 1356 and 1450. and find

$mailer->setQueue($emailQueue)->send(); in order.php file and change/replace to
$mailer->send();

Step-2 : Goto app/design/frontend/base/default/template/checkout/success.phtml

And add the following line on the top of success page for sending mail directly

$order = Mage::getModel('sales/order');
$incrementId = Mage::getSingleton('checkout/session')->getLastRealOrderId(); 
$order->loadByIncrementId($incrementId);

try{ $order->sendNewOrderEmail();} 
catch (Exception $ex) { echo "Email Not Sent..."; }
$customer = Mage::getSingleton('customer/session')->getCustomer();
$email = $customer->getEmail();//End Email Sending

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM