Our blog

 

Magento Newsletters Not Sending + Solution

If you are scratching your head trying to figure out why your Magento is not sending out newsletter emails then this post is what you need.

Magento has a script called cron.php which handles all of the timed jobs that your Magento store has to do. In this list is the task of sending out newsletters. You have to set up your server crontab to run this cron.php script at regular intervals (eg 5 minutes).

Once you do this, you should find that your newsletter will be sent out as expected.

See this page for some instructions

However - here are my simple instructions for a linux server.

1. Open up an SSH session with your server. (If you can't do this you are going to have to ask your hosts to do this for you instead).

2. Browse to the document root of your magento store, the folder with cron.php in there

3. enter the command

CODE:
  1. pwd

This command gives you the current full path. Write this down somewhere

4. enter the command

CODE:
  1. which php

This command gives you the path to your PHP binary. Write this down somewhere

5. enter the command

CODE:
  1. crontab -e

This opens up your crontab editor which is the system for scheduling tasks on Linux

6. hit the [I] key to go into insert mode on the crontab editor (vi basically)

7. on a new line paste the following, but replacing the paths with the paths you got before

CODE:
  1. */5 * * * * /path/to/php -f /path/to/cron.php

8. Hit [Esc] then type the command

CODE:
  1. :wq

This saves the crontab

9. Create a newsletter and schedule it to send in 2 minutes time.

It should send. If it doesn't then something else is wrong, but hopefully this should fix it for you.

More...

More Reading:

7 Comments

Chris
May 19th, 2009

First of all thank you for this. The cron worked because in magento it is stated that the emails are being sent. However, i have the mail function working for SMTP and every other email within magento works, so the mail function isn't the problem. So do you have any idea why the emails are not arriving?

Thanks

 

admin
May 19th, 2009

Most other emails will be sent instantaneously whereas the newsletter emails are queued up and sent by the cron system..

Have you set up a cron job to run the cron script?

If not then do that and your newsletter issues should be resolved.

 

Jimmy
February 18th, 2011

We are having the same problems as Chris, the cron is running good, the status is set to "Sent" but no e-mail arrives to our test accounts. In our control file we find the following:

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0

Our live site is under www map en our test site is under www2 map, the cronjob is set up to run on the www2

What can be the problem?
Thanks,

 

Frank Luzon
March 15th, 2011

Thank man, you just saved me! It works perfectly, thank you very much!

 

Thomas
October 12th, 2011

Thanks for this post ;-)
However, if this doesn't work for you, try to add a simple

echo "done!";

into your cron.php code.
It will be found at:
yourdomain.com/MAGENTOROOT/cron.php

seems strange, yes but thats how it finally works for me ;-D

 

Ecoist
October 18th, 2011

Thank you so much for your nice instruction. A newsletter was sent from my Magento finally! Yay!

To tell the truth... a little embarrassing... I did not understand I needed to setup crontab of Linux for Magento's cron.php though read many instruction sites. I could understand it finally thanks to yours.

 

jebins
December 30th, 2011

Yes.. Thank you very much for your instruction.. I was searching for this solution for almost two days.. Now It is working for me..

 

 

Leave a Reply