Problem with cronjob, Newsletter Builder and cpanel
2 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: August 1, 2013 (RSS)
By JeffC - August 1, 2013
I have set up newsletter builder and have everything working correctly up to sending a TEST email. I can not send the email to my full list unless I manually go into Admin/Plugins/Background Mailer.
I understand that I need to run this script:
php -q /home/******/public_html/******.co.uk/cmsAdmin/plugins/newsletterBuilder/background-mailer.php.
My web host uses cpanel so I assume I add a new cron job and copy and paste this filepath into the command line.
Cpanel insists that I select a frequency to run the script. My host tells me that I am restricted to sending 500 emails per hour and so I should use cpanel to run the script every hour of everyday (my database has 15,000 entries so I assume the script will run every hour for 30 hours until all emails are sent.
I am guessing I have completely missed something here! Any help gratefully received
By gregThomas - August 1, 2013
Hi,
You can set the number of emails and the frequency and maximum number of e-mails to be sent inside the background mailer itself, at the top of background-mailer.php on line 6 you should see these lines:
// Mail limits - If your server or host requires it, you can limit mail sending speed below
$GLOBALS['BACKGROUND_SEND_MAX'] = 80; // max messages to send in each batch, eg: If a cronjob runs the script every 10 min and this is set to 80, you'll send approx 480 emails an hour
$GLOBALS['BACKGROUND_SEND_WEB_MAX'] = 25; // max messages to send when calling mailer through web interface, browser sessions can timeout so set this low (example: 25)
$GLOBALS['BACKGROUND_SEND_DELAY'] = 0; // second to wait after sending each message
So if you set the CRON to run every 10 minutes, these default levels should be about right for your limit of 500 emails per hour.
Thanks!
Greg
PHP Programmer - interactivetools.com