• Resolved stvwlf

    (@stvwlf)


    Hi – On a site that is a WordPress install that uses WP Mail SMTP, I have a WordPress script that runs in a cron job. The script loads WordPress by having
    require('./wp-load.php');
    at the top of the script. At the end of the script I call wp_mail() to send an email. I’ve been receiving these emails correctly for months. Last night I discovered I’ve not gotten a cron email since October 30, and the last email I received was from 30 minutes before I installed the latest WP Mail SMTP plugin upgrade.

    I did a lot of testing last night. I learned that when I run the WordPress script manually as a URL in the browser I receive the emails as intended. When the script runs as a cron job, it no longer sends its emails. Since these worked right until I upgraded the plugin I assume something’s changed in the plugin that prevents the email during the cron job. Any suggestions?

    Thank you

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Slava Abakumov

    (@slaffik)

    Have you observed the PHP error_log? Were there any records for that?
    The problem might be with this string in a plugin .php file:

    
    $server_name = ! empty( $_SERVER['SERVER_NAME'] ) ? $_SERVER['SERVER_NAME'] : wp_parse_url( get_home_url( get_current_blog_id() ), PHP_URL_HOST );
    

    But I need a confirmation. Please try to test by changing that string to:

    
    $server_name = $_SERVER['SERVER_NAME'];
    

    Can you please prepare a minimum working failing example with all the steps?

    Plugin Author Slava Abakumov

    (@slaffik)

    In 0.11 we changed the SMTPAutoTLS option to off. In 1.1.0 we returned it back to on plus gave ability to off for all who needs that.

    Emails are sent from WP CLI, as far as I’ve tested. There might be issues on local installs, but that hugely depends on local installs, so nothing to do here.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Emails no longer sent from cron job’ is closed to new replies.