MyBB Community Forums

Full Version: PM e-mails and e-mail subscription alerts seem delayed
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8
Hi,

Here is the PHP file that should process the mail queue:

<?php

defined('IN_MYBB') or define('IN_MYBB', true);

require_once __DIR__ . '/init.php';

$numToSend = 20;

send_mail_queue($numToSend);


It should be uploaded to "./inc/cron_mail_queue.php". The crontab entry to run this every 5 minutes should be as follows (assuming PHP is at /usr/bin/php):

*/5 * * * * /usr/bin/php  /var/www/path_to_mybb/inc/cron_mail_queue.php

Hopefully that will work Big Grin
Thanks Euan.
Is that all of the php code as it missing the end php>
Just wanted to check before trying it.
Thanks
missing end ?> is how MyBB files are Smile
Doh ! Meant to type that but fingers and brains weren't in sync !! Wink

(2015-03-15, 02:43 PM)Euan T Wrote: [ -> ]Hi,

Here is the PHP file that should process the mail queue:



<?php

defined('IN_MYBB') or define('IN_MYBB', true);

require_once __DIR__ . '/init.php';

$numToSend = 20;

send_mail_queue($numToSend);


It should be uploaded to "./inc/cron_mail_queue.php". The crontab entry to run this every 5 minutes should be as follows (assuming PHP is at /usr/bin/php):



*/5 * * * * /usr/bin/php  /var/www/path_to_mybb/inc/cron_mail_queue.php

Hopefully that will work Big Grin

That's has worked an absolute treat Euan and I am very grateful.
Composed a PM and didn't click around the boards. Within 5 minutes I received the notification Smile

I know that some people may say setting a cron every 5 minutes isn't the best but it wouldn't be hitting any bandwidth due to it being a low activity board.

@Shemo - would this method work for you?

As Leefish would say ' All Hail the Mighty Cron job' Wink
Glad it's working Smile It should be more efficient than the standard way of doing things as emails are sent in the background without slowing the user experience down at all.
I haven't had a chance to do any further testing since chatting with Euan last night. I'll try to get around to it tonight.

I don't understand why this wasn't a problem in the past, but since 1.8.4 (as far as I can tell, at least), it's become an issue with consistency.
I'm not sure either. Nothing relating to how the actual emails are sent has been changed since 1.2...
if I am understanding this correctly, I need to find the file "cron_mail_queue.php", edit and add the above code, correct? And then add the cron job code? Is this going to work with PHP or SMTP mail settings
Hi,

You will need to create that file with the above code, then add the cron job via either your server's command line or control panel. It will use whichever email system you have configured within MyBB.
Just uploaded and added the crontab code. How do I see if it works with 2 previously written, but never sent mails?
Pages: 1 2 3 4 5 6 7 8