is we need to pay and return to site successfully to get paypal order confirmation email

The question:

we are not getting order confirmation email if customer placed an order through paypal.but we get invoice and shipment mails.

we set Sale : Payment Action in paypal configuration.

so once we create the order, along with the order email [its not going to customer] i want to send invoice mail also to customer. i think this extension will send invoice only once order status become complete.

if we use SMTP extension will it work for us ?

is there any thing else we need to do ?


also I want to know is Email will send only if we pay money and succesfully return to site ? If we just click on “place order” & redirect to paypal page, will it not send email ?

2016-06-13T20:15:10+00:00 ERR (3): 
exception 'Mage_Paypal_UnavailableException' with message 'Empty response.' in /home/site/public_html/app/code/core/Mage/Paypal/Model/Ipn.php:166
Stack trace:
#0 /home/site/public_html/app/code/core/Mage/Paypal/Model/Ipn.php(116): Mage_Paypal_Model_Ipn->_postBack(Object(Varien_Http_Adapter_Curl))
#1 /home/site/public_html/app/code/core/Mage/Paypal/controllers/IpnController.php(43): Mage_Paypal_Model_Ipn->processIpnRequest(Array, Object(Varien_Http_Adapter_Curl))
#2 /home/site/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Paypal_IpnController->indexAction()
#3 /home/site/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#4 /home/site/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#5 /home/site/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#6 /home/site/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#7 /home/site/public_html/index.php(87): Mage::run('', 'store')
#8 {main}

The Solutions:

Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.

Method 1


we are not getting order confirmation email if customer placed an order through paypal.but we get invoice and shipment mails.

This clarifies one thing: that your email sending mechanism (likely the Magento cron) is working correctly in general.

if we use SMTP extension will it work for us ?

Whether you implement this extension or not, it will not affect whether your PayPal order emails work. This module is designed to sit in the background and take the regular email send jobs from the core Magento mail module and do its own thing with them. You will not notice a difference in regular Magento use from installing it, other than an email log table in Magento admin which contains a history of your sent emails.

If you have installed this extension, you could use that email log in Magento admin to check what has been sent. You can access it via System -> Tools -> SMTP Pro - Email Log.

also I want to know is Email will send only if we pay money and succesfully return to site ? If we just click on “place order” & redirect to paypal page, will it not send email ?

Emails are sent when certain status changes occur on various models in Magento. Order emails are sent when an order reaches the processing status, which means it has been invoiced and paid (payment method has been charged [capture() method]). Invoice emails are sent when the order’s invoice is created (normally/often when the order is created as well). Shipment emails are created when a shipment is created for an order, etc…

Yes – the email will send only if you’ve completed the PayPal transaction and successfully returned to your Magento site (and Magento has successfully registered that payment against the order and saved it).

If you just click on “place order” & redirect to PayPal page, it will not trigger any emails to be sent. Your order doesn’t exist at this point, it is simply a quote waiting to be converted to an order when the customer returns from PayPal.

The code

If you take a look at Mage_Paypal_Model_Express_Checkout::place() as an example, you will see the following conditions apply to when Magento will send (queue) a new order email. This method is triggered when customers return from PayPal (the returnAction in Mage_Paypal_Controller_Express_Abstract sends them here via ->placeOrderAction() then $this->_checkout->place()):

# File: app/code/core/Mage/Paypal/Model/Express/Checkout.php
switch ($order->getState()) {
    // even after placement paypal can disallow to authorize/capture, but will wait until bank transfers money
    case Mage_Sales_Model_Order::STATE_PENDING_PAYMENT:
        // TODO
    // regular placement, when everything is ok
    case Mage_Sales_Model_Order::STATE_PROCESSING:
    case Mage_Sales_Model_Order::STATE_COMPLETE:
    case Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW:

Essentially the email will be sent (queued) if the new order’s state is either “processing”, “complete” or “payment_review” – have you checked the affected PayPal orders to see what their status is? You say you can ship them, so I assume that they’re “processing”.

The one exception as you can see above is when the state of the new order is “pending payment”. The comment from the Magento developers explains it, but it can happen in a delayed payment situation. I would suggest that this is not very common.

Of course, that switch statement is specific and doesn’t contain a default case (side note: this breaks the Zend style guidelines, but so does a lot of the core Magento code!). This means that if the order state is not any of the ones mentioned, the order will also not be sent (queued).

Where to from here?

I’d suggest you do the following:

  • Get a PayPal sandbox account set up in your development environment so you can test it yourself!
  • Inspect the status of new PayPal orders as they come in. Look at the status of the orders. Look at the history of the order to see if anything seems out of the ordinary. Try changing the email on one of the orders to yours and triggering the order email to be re-sent manually from the order view screen in Magento admin (this will eliminate the email template itself as an issue)
  • Enable PayPal logging, and inspect the API logs as the requests are made (best done in a development environment, assuming you can reproduce it)


The comments/suggestions I’ve made above assume that you don’t have any third-party or custom made modules getting in the way of any of the orders or payments processes in Magento. If you do, you should mention them!

Good luck, hope this helps!

Method 2

Form Magento1.9 Order mail send via cron job .

But You can overcome using this simple free Extension, install this extension they will give you option make e-mail in queue or not

For Paypal Mail, complete your transaction after that you will get the mail

Method 3

You might need to disable SSL verification,
under the

System > Configuration > Payment methods > Paypal > Advanced settings > Enable SSL verification

Method 4

I hope your cron working properly as magento sends confirmation mails on cron job. see this and check if your emails being stored in core_email_queue and core_email_queue_recipients.

Method 5

The real problem was some unaffected files. as some files of sites was attacked by hackers, our hosting team blocked some ports [80 or some other ports ] , after we deletd those those files, hosting team unblocked those ports , than emails are going like anything…..

Method 6

You should check your paypal configuration on your paypal account

Method 7

Here is the Latest Solution

Please try and le me know- check my blog


You need to add some code in


    $order = Mage::getModel('sales/order');
    $customer = Mage::getSingleton('customer/session')->getCustomer();
    $incrementId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
    $order = Mage::getModel('sales/order')->loadByIncrementId($incrementId);
    $countryCode = $order->getShippingAddress()->getCountry();
                                    catch (Exception $ex)
                                        echo "Email Not Sent...";
                            $customer = Mage::getSingleton('customer/session')->getCustomer();
                            $email = $customer->getEmail();//End Email Sending

Method 8

I had the same problem and it was caused by magento core bug.

In my exception.log file I had the following error:

main.CRITICAL: Notice: Array to string conversion in /home/mywebsite/public_html/var/view_preprocessed/pub/static/vendor/magento/module-payment/view/frontend/templates/info/default.phtml on line 1

If you want to fix it, create your own version of file vendor/magento/module-payment/view/frontend/templates/info/default.pthml in your theme and change line:

<th scope="row"><?= $block->escapeHtml($label) ?></th>


    $x = $block->getValueAsArray($value, true); 
        foreach($x as $y){
            echo $y;
        echo $x;

It’s a very basic fix but it worked on my case.

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Comment