Magento 1.9 avoid Cron job for not sending mail

Magento 1.9 and higher use Cron jobs for sending mail. If your cPanel is not configured correctly for Cron jobs the Sales mails may not be sent or received by the users.

To avoid Cron jobs follow the below instructions.

1. Navigate to: app/code/core/Mage/Sales/Model/Order.php  (you may need and FTP client such as Cute FP)

2. Open Order.php

3. Change

 

$mailer->setQueue($emailQueue)->send();

to:

$mailer-> send();

 

4. Navigate to:  app/design/frontend/base/default/template/checkout/success.phtml

5. Add following line at the end of the file.

 

$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

 

For more info click here.


Print   Email

Related Articles