News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

Emails Stuck in Mail Queue

Started by Darkness7148, June 27, 2025, 12:55:38 PM

Previous topic - Next topic

CRM 114

Quote from: Oldiesmann on July 02, 2025, 10:10:00 PMAfter making the change if you go to the mail queue and click "Send queue now", it should send all the emails that are stuck in the queue (though I don't recommend doing this if you have a ton of emails in the queue - I only had 3 to 5 messages in the queue on each)
I have 3 Mails stuck in the queue, when i click on the "send queue now", nothing happens.
German Wet Shaving Forum: www.gut-rasiert.de/forum

CRM 114

Quote from: CRM 114 on July 02, 2025, 10:51:32 PMI have 3 Mails stuck in the queue, when i click on the "send queue now", nothing happens.
Priority is "Very high".

Values in table settings:
mail_failed_attempts: 23
mail_limit: 10
mail_next_send: 0
mail_quantity: 10
mail_recent: 1751511038|10
mail_type: 1

The changes I made in ScheduledTasks.php, as described here:
You cannot view this attachment.
German Wet Shaving Forum: www.gut-rasiert.de/forum

peter_mein

Where has line 823 gone?
It is not deleted.

CRM 114

Maybe I missunderstood

Find:
$email['priority'] = max($priority_offset, $email['priority'], min(ceil((time() - $email['time_sent']) / $smtp_expire * ($max_priority - $priority_offset)) + $priority_offset, $max_priority));

// Don't send if it's too soon. Also, if we've already failed a few times, only send on every fourth attempt so that we don't DOS some poor mail server.
if (time() < $next_send_time || ($email['priority'] >= $priority_offset && $email['priority'] % 4 !== 0)) {

Change to:
// Don't send if it's too soon. Also, if we've already failed a few times, only send on every fourth attempt so that we don't DOS some poor mail server.
if (time() >= $next_send_time) {

Anyway, I copied line 823 back from the backup, but this did not solve the problem.

And: The second change affects 2 lines (828 and 857). Is this correct?

Can someone provide his fixed ScheduledTasks.php here, so I can check it?
German Wet Shaving Forum: www.gut-rasiert.de/forum

petewadey

Quote from: CRM 114 on July 03, 2025, 03:51:04 AMAnd: The second change affects 2 lines (828 and 857). Is this correct?



I also found 2 lines


CRM 114

German Wet Shaving Forum: www.gut-rasiert.de/forum


Oldiesmann

Quote from: CRM 114 on July 03, 2025, 12:32:09 AM
Quote from: CRM 114 on July 02, 2025, 10:51:32 PMI have 3 Mails stuck in the queue, when i click on the "send queue now", nothing happens.
Priority is "Very high".

Values in table settings:
mail_failed_attempts: 23
mail_limit: 10
mail_next_send: 0
mail_quantity: 10
mail_recent: 1751511038|10
mail_type: 1

The changes I made in ScheduledTasks.php, as described here:
You cannot view this attachment.

Add ++$email['priority']; in there where line 823 was.


CapnK

Can also confirm that the code on GitHub quoted above works, v SMF 2.1.6.  Thanks for the tip!

Cypheros

Yes the fix works for me, too.  :)
Attached the changed ScheduledTasks.php for 2.1.6 using "Fix mail queue #8716" from jdarwood007 on Github.

Mike66

Thanks, that solved it for me too.

Pogo Stick

I've replaced with the modified ScheduledTasks.php file and it all works again.

Will I need to revert to the original file whenever the next update (2.1.7?) is shipped, possibly next year?

Aleksi "Lex" Kilpinen

In order to avoid possible issues, yes it's better to revert changes first.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Sudhakar Arjunan

Without understanding this issue, I was afraid as no emails sent and installed send grid for smf and activate that trail for 2 months and used it for sending emails for last few months.

Today I spent 1 hour+ to understand all facing issue on mail queue after migrating from 2.1.4 to 2.1.6. Including the repository all details are clearly given and hope in 2.1.7 it should be fixed as git shows 78% something is already done but no release date yet.
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

Oldiesmann

It will be fixed whenever 2.1.7 is released, but the fix is quite simple and you don't need to wait. The 78% done thing just means that 78% of the tasks that developers have flagged for that version are completed. It doesn't really have any relation to how soon that version will be released.

Pogo Stick

For reference, the time between 2.1.4 and 2.1.5 was 2 years.

CRM 114

But between 2.1.5 und 2.1.6 ist was 2 days. :D
German Wet Shaving Forum: www.gut-rasiert.de/forum

stoo23

Yep, ... instantly Fixed things for me as well  :)  .... Thanks !!

Advertisement: