News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

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!

Advertisement: