New order email confirmation not being sent

I have upgraded my website to 1.9.1 and now my customers are not receiving order confirmation email.

I tried sending through the admin panel but nothing happens, also no update email is being received.

Solutions

There are 2 methods to send mails from our Magento 1 store.

  1. By Using cron
  2. By Avoiding cron

If you want to avoid cron :

Open your order.php file at

app/code/core/Mage/Sales/Model/Order.php

Line#1356,1450,

change

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

to:

$mailer-> send();

In app/design/frontend/base/default/template/checkout/success.phtml: add 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
  1. Starting with Magento 1.9.1 the emails are not being sent directly during checkout but instead are being queued.
  2. The queue is being processed via your Magento cronjob - please ensure this has been set up and is running correctly.
  3. The extension AOE_Scheduler can help you in confirming that your Magento cronjob has been configured correctly and is running.

i removed the following mail queue code from Template.php , then i started receiving email when the order is placed by customer or when i click send email from the admin panel "Sales/Orders" tab.

Magento had set the order email to be sent by schedule job instead of instant email... probably for performance reason?(i dont know why, i am very new to magento)... however i am going to put this code back in the Template.php and find a way to set and run the schedule job to run every 5 minutes...

Template.php is located in => /app/code/core/Mage/Core/Model/Email/Template.php

   if ($this->hasQueue() && $this->getQueue() instanceof Mage_Core_Model_Email_Queue) { 

    /** @var $emailQueue Mage_Core_Model_Email_Queue */
        $emailQueue = $this->getQueue();
        $emailQueue->setMessageBody($text);
        $emailQueue->setMessageParameters(array(
                'subject'           => $subject,
                'return_path_email' => $returnPathEmail,
                'is_plain'          => $this->isPlain(),
                'from_email'        => $this->getSenderEmail(),
                'from_name'         => $this->getSenderName(),
                'reply_to'          => $this->getMail()->getReplyTo(),
                'return_to'         => $this->getMail()->getReturnPath(),
            ))
            ->addRecipients($emails, $names, Mage_Core_Model_Email_Queue::EMAIL_TYPE_TO)
            ->addRecipients($this->_bccEmails, array(), Mage_Core_Model_Email_Queue::EMAIL_TYPE_BCC);
        $emailQueue->addMessageToQueue();

        return true;
    }
Tags: Email / Upgrade / Cron

Similar questions

Magento 1.9.1 Email Queue - Order Email Being Sent to Numerous Customers
I am having issues with the order emails. This is not the typical issue with emails not sending. I have a cron job set up properly and all order emails are properly being sent to customers. BUT... I noticed that one order confirmation email was sent to 3 customers today. The issue will not be detected if you have confirmed shipment on your prior or...
New order email being sent twice
I'm using Magento 1.9.1 and when creating a new order, whether it's from the frontend or Admin, the system is sending out 2 emails - both the same! I've looked on the net and found a bug which was an old one and I couldn't find the code mentioned to comment out, it also looked like that was to do with Paypal orders and this isn't the case. I've dis...
Order # 000000012 (The order confirmation email was sent) in localhost
In Magento 2 email is not received after order is placed. How to fix that issue? am using in localhost and also i configure with SMTP still email will not received
Magento 2 order confirmation email not sent
I'm working on a clients' store, and face a problem with no order confirmations being sent. The following error is logged in system.log: Looking for that error, I see that it is generated here: Zend\Mail\Address.php Address used: Firstname Surname Street 1 Village, 4444GH Nederland T: 1234567890 [email protected] What is the exact issue? Im not ...
We are using Magento 2.3.4 The order confirmation email is not sent
the order confirmation email is not sent to customer how to fix this problem....moreover the problem is entirely different,here welcome email,forget password, shipping and invoice mails are delivered but order confirmation email only not going please help me someone
Magento 1.9.1 - Emails being sent by the new email queue?
According to the Magento 1.9.1 release notes: all Magento e-mails (including order confirmation and transactional) are now queued However, I cannot see how any emails except the new order and order update emails are being queued. In this answer you can see the only two places that appear to use the queue. Am I missing something obvious that would h...

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.