I'm using the Subscribe by Email plugin (this isn't related

Hey! I'm using the Subscribe by Email plugin (this isn't related to that plugin tho, well kind of) on this site: foreverfreckled.com

Here's the issue: a bunch of their subscribers are saying the emails go to spam.

SO I thought I'd try (for the zillionth failed time) to hook them up with WP Mail SMTP which I always find through various forms is the solution to this issue.

Here's the thing, I've tried this dozens of times and NEVER gotten it to work. I've never successfully even sent a test email - not even once. Please tell me what I'm doing wrong! I've attached the settings, and the site is on GoDaddy.

Thanks in advance!

  • Michael Bissett

    Hey @ansley! :slight_smile:

    You may wish to try using a different SMTP plugin for this site, like this one:

    https://wordpress.org/plugins/easy-wp-smtp/

    However, should that not do the trick, could I ask you to insert this code snippet into your site as an mu-plugin, and then try sending out another test email?

    <?php
    
    /**
     * Logs error to file
     *
     * @uses <code>error_log</code> function to log on file
     *
     * @param string $error message of the error
     * @param string $type type of the error message
     */
    function log_error( $error, $type = 'error' ) {
        $path = dirname( __FILE__ ) . '/log.txt';
        $msg = sprintf( "[%s][%s] %s\n", date( 'd.m.Y h:i:s' ), $type, $error );
        error_log( $msg, 3, $path );
    }
    
    /**
     * Log the mail to text file
     *
     * @uses <code>wp_mail</code> filter
     * @param array $mail
     */
    function wedevs_mail_log( $mail ) {
    
        $message = "to: {$mail['to']} \nsub: {$mail['subject']}, \nmsg:{$mail['message']}";
        log_error( 'mail', $message );
    
        return $mail;
    }
    
    add_filter( 'wp_mail', 'wedevs_mail_log', 10 );

    And after the test email is sent out, could you please attach the log.txt file generated by that snippet to the thread here please? :slight_smile:

    Kind Regards,
    Michael

    P.S. Shoutout to tareq.wedevs.com for the code snippet, thanks! :slight_smile:

    http://tareq.wedevs.com/2012/03/log-wordpress-outgoing-mails-for-debugging/

  • Michael Bissett

    Hey @ansley, thanks for your patience here! :slight_smile:

    Is that code missing a closing php tag?

    Nope, the code wasn't missing a closing PHP tag, it's not necessary to add it here. :slight_smile:

    I tried Easy WP SMTP first actually, thinking maybe I could get THAT one to work, to no avail. Plus it doesn't have the handy log feature (not that I know what the log is saying), I just waited and waited for the test email that never came.

    Having a look at your log file here, I'm seeing this error come up:

    ERROR: Failed to connect to server: Connection refused (111)

    After doing a bit of investigating here, I'd like to ask if you could try using this plugin on your site instead:

    https://wordpress.org/plugins/postman-smtp/

    If that doesn't do the trick though, then I'd like to ask if you've confirmed that you've entered the login details correctly? What if you were to try using TLS temporarily (instead of SSL), does that work?

    Another cause of this can be the firewall that your hosting company has, you may wish to check with them about this as well.

    Kind Regards,
    Michael

    P.S. As that log file included the password for your Gmail login, I've removed the attached log you posted, and re-attached a cleansed version of it here. Just to be safe though, you may wish to change the password for your Gmail account.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.