We have 2 methods to send the confirmation emails from our Magento 1 website.
- Using Cron
- Avoiding Cron
If you want to avoid the Cron :
Open the file order.php file from the following path:
app/code/core/Mage/Sales/Model/Order.php
Line#1356,1450
Change the following
//$mailer->setQueue($emailQueue)->send();
to the following:
$mailer-> send();
In the following path `app/design/frontend/base/default/template/checkout/success.phtml`:
add the following line Top success page for sending mail direct
$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