0

I have created a Newsletter template and place that in newsletter queue. But i couldn't receive any mail.

Can anyone help me to sort out the problem.
My cron.php looks like this

require 'app/Mage.php';

if (!Mage::isInstalled()) {
    echo "Application is not installed yet, please complete install wizard first.";
    exit;
}

// Only for urls
// Don't remove this
$_SERVER['SCRIPT_NAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_NAME']);
$_SERVER['SCRIPT_FILENAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_FILENAME']);

Mage::app('admin')->setUseSessionInUrl(false);

umask(0);

try {
    Mage::getConfig()->init()->loadEventObservers('crontab');
    Mage::app()->addEventArea('crontab');
    Mage::dispatchEvent('default');
} catch (Exception $e) {
    Mage::printException($e);
}
1

To send the newsletter in queue, you will have to set the cron job for the website. There are two ways to setup cron on the website.

1) If you have cPanel, set the cron job from there

2) You can set the cron using the shell.

You can set the cron on cron.php file on your Magento root directory. To setup the cron using shell use below command:

Method 1:

*/5 * * * * curl -s -o /dev/null http://www.yoursite.com/absolute/path/to/magento/cron.php

Method 2:

*/5 * * * * wget http://www.yoursite.com/cron.php

For further details regarding setting up cron you can have a look at below two articles

1) http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/how_to_setup_a_cron_job

2) http://www.thesitewizard.com/general/set-cron-job.shtml

  • Hi, Can you please let me know the process if i have cpanel. I couldn't get solved the problem. – Kishor Mar 2 '15 at 3:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.