Support » Plugin: SMTP Mailing Queue » 5000+ emails taking 10-25 minutes pause in between

  • Hi

    On site we have 5000+ users. When Admin published new POST it will create queue and start sending emails but I noticed that after 25-30 minutes it’s paused for 10-20 minutes after that it will again start sending email for 25-30 minutes and again paused for 10-20 minutes.

    Wordpress version – 5.7.2
    PHP version – 7.1.8
    Better Notifications for WP Version – 1.8.11
    Email Log Version – 2.4.8
    SMTP Mailing Queue Version – 1.4.7

    Note – We will be Update PHP and WordPress version to it’s latest after 3-6 months.

    Advanced Settings
    Queue Limit – 100
    wp_cron interval – 30
    Min. recipients to enqueue – 1
    Max. retry for mail sending – 0
    Sent mail storage size – 0

    Also today I noticed that there is error on admin page (wp-admin/options-general.php?page=smtp-mailing-queue&tab=supervisors)

    Error encountered while processing queue : ‘cURL error 28: Operation timed out after 30001 milliseconds with 0 out of -1 bytes received’

    I need to also know that we have php setting MAX_EXECUTION_TIME is set to 30. is it neccessory to use same or below in wp_cron interval or should I use 60+.

    Thank you
    Akash Darji

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter Akashkumar Darji

    (@akashkumardarji)

    Also I found in Sending Errors

    To: field is missing

    This happened for more than 5 emails

    Plugin Author Birmania

    (@birmania)

    Hi @akashkumardarji,

    As for the error “To: field is missing”, it means that the associated email was sent through “wp_mail” without any value in the “To” heading field.
    This may occurs for users who do not have any email associated to their account. This could also occur if you have some plugins that erase/override the “To” field on “wp_mail” call.

    Thanks for communicating yours settings, it is very helpful to understand your errors.

    The fact that you experiments pauses in mail sending may have two possible causes :
    [1] In WordPress, cronjobs may unregister themselves in some really strange contexts (with multiple failures, etc…).
    SMTP Mailing Queue have a “recovery” mechanism that will re-queue the cronjob once every hour if it was unregistered.
    It would be very interesting to check if you can find the following cron events registered while you are exprimenting a pause :
    – smq_start_queue (The concrete job that send mails)
    – smq_sanity_checks (The job that recover “smq_start_queue” in case of failure)

    [2] How do you manage your wp-cron jobs ? If you are running cron job through userview, pause may be due to the fact that there is not enough visitor on your website during these periods. In this situation, I recommend to use self-managed wp-cron call from external actor like system cron or online wp_get cron provider.

    In addition to that, it is a bit surprising that you get a cURL timeout after 30 seconds because it means that your SMTP provider (or your server host) is really slow to process. In this situation, you can try to help the system by reducing your global throughput or keeping the same throughput but with smaller batches. This may reduce the probability to get concurrent cron job running and so reduce probability to get “smq_start_queue” unregistered.

    In order to reduce the global throughput, try the following configuration :

    • Queue Limit : 30
    • {One second available per mail to send}

    • wp_cron interval : 60
    • {Higher wp_cron interval allow to let the process breath and avoid overlapping}

    `

    To get the same throughput as before but with smaller batches, try the following configuration :

    • Queue Limit : 30
    • {One second available per mail to send}

    • wp_cron interval : 10
    • {Risked value but allow to keep the same throughput that you already have}

    Bonus :
    Do not hesitate to set an higher value on “Max. retry for mail sending” as it will allow the plugin to reschedule failed mails X times before giving up.

    Yours faithfully,
    Birmania

    Thread Starter Akashkumar Darji

    (@akashkumardarji)

    Thank you for quick response.

    I will try above points.

    I found one more issue.

    when user try to reset password, reset password link show in email log perfect but when plugin send email to user reset password linked changed to “https://u26054318.ct.sendgrid.net/ls/click?upn=*****” something like this.

    Thank you
    Akash Darji

    Thread Starter Akashkumar Darji

    (@akashkumardarji)

    Also Reset Password Email format is showing with HTML tags

    Thread Starter Akashkumar Darji

    (@akashkumardarji)

    I fixed the HTML formatting issue

    public function processQueue($checkKey = true) under function inside for loop
    Filename = classes/SMTPMailingQueue.php

    added below code

    foreach ($mails as $file => $data) {
    if( $data[‘headers’] == “” ){
    $data[‘headers’] = array( “Content-type: text/html” );
    }

    can you please update me on link? why link is changed as I can see in debug mode link look good even under Email Log looks good but when User Receive the email link is changed.

    Plugin Author Birmania

    (@birmania)

    Hi @akashkumardarji,

    As for the HTML content type, it may be related to the following issues :
    https://wordpress.org/support/topic/html-markup-in-email-content/
    https://wordpress.org/support/topic/problem-with-a-forum-plugin/

    I have got an idea to solve this on long term basis, but it need a little bit of work to be ready.
    Meanwhile, you can use the following workaround :

    function wp_set_html_mail_content_type() {
        return 'text/html';
    }
    add_filter( 'wp_mail_content_type', 'wp_set_html_mail_content_type' );

    Warning : this will set text/html content type on every mail you will send.

    As for your reset password link which is rewritten, I think that it is a sendgrid feature that allow you to track when a user click on links in mails you are sending.

    You have two fast/easy way to bypass this feature :
    [1] Follow this tutorial to disable link tracking for every mail you are sending through Sendgrid : https://help.groundhogg.io/article/313-disable-tracking-links-on-sendgrid
    [2] Override your “retrieve_password_message” through the associated WP filter and add clicktracking=off in the <a/> tag of the reset password link.

    Yours faithfully,
    Birmania

    Thread Starter Akashkumar Darji

    (@akashkumardarji)

    Thanks for Super Quick Response.

    I will check and update you

    Thread Starter Akashkumar Darji

    (@akashkumardarji)

    Everything work perfectly.

    Thank you

    Can you please tell me when will be the plugin ready to use with latest version of WordPress and PhP version 8+?

    Thanks Again

    Thread Starter Akashkumar Darji

    (@akashkumardarji)

    Hi

    I found one more error when user email id contains ‘

    email not sent out

    suppose user email is demo’one@example.com it’s convert to demo\’one@example.com

    before we don’t have this type of error during mail sent

    Thank you
    Akash Darji

    Plugin Author Birmania

    (@birmania)

    Hi @akashkumardarji,

    I have just updated the plugin to v2.0.0 with multiples fixes related to issues you encountered.
    I have high hopes that it will solve your issues but if it does not, tell me.

    In addition, I tested the plugin on WP 5.9.3 with PHP 8.1.6 and everything is working well.

    Yours faithfully,
    Birmania

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘5000+ emails taking 10-25 minutes pause in between’ is closed to new replies.