• Hi,

    wp_mail function doesn’t work after update WP to version 4.6.

    My code is:

    $headers = 'From: ' . $this->from_name . ' <' . $this->from_email .'>' . "\r\n";
    wp_mail( $service->getEmail(), $this->admin_daily_subject, $admin_daily_message, $headers );

    It worked perfectly before WP update. Also I’ve noticed that sending emails doesn’t work in Contact Form 7. Any ideas? Thanks in advance.

Viewing 11 replies - 1 through 11 (of 11 total)
  • wp_mail has stopped working for me as well. Since the update.

    It also stopped working for me. I hope someone can post a solution to this problem. I rely on this for my business.

    I’ve managed a work-around using PHP’s mail() instead, but I’d rather use wp_mail. After looking into it a bit, it seems someone on Stack Echange tried this solution too and it worked for them also.

    Hopefully there’ll be some update to the codex soon.

    wp_mail stopped working for me also after the update to WordPress 4.6. The PHPMailer Error reads ‘Could not instantiate mail function’

    I found another fix with includes the third parameter on setFrom in PHPMailer:
    $mail->SetFrom("[email protected]","my name", 0); //notice the third parameter

    The solution was found here: https://stackoverflow.com/a/35675307

    I hope the WordPress Team soon releases a fix for this problem.

    Moderator Marius L. J.

    (@clorith)

    Hi,

    Some changes were made to how wp_mail works in 4.6, what would help with troubleshooting this is if you could share your site URL and the title you used under Settings > General for the site title as these are the default values used when sending emails so they would help greatly in tracking this down.

    Hi Marius,

    The site I’m working on which is concerned by the update to wp_mail:

    URL : https://www.universdejeff.com/
    Pages where the problem occurs : https://www.universdejeff.com/devis and https://www.universdejeff.com/contact

    Site title : L’Univers de Jeff

    Moderator Marius L. J.

    (@clorith)

    So just to do our due diligence, you’ve made sure ALL plugins (no matter how little and unrelated it may seem) are disabled, and possibly even running Twenty Sixteen as your theme?

    I’ve so far been unable to reproduce the problems, even when replicating the domains and site titles of affected users.

    in hook you must set correct $phpmailer->Sender (like your smtp mail)

    @fe-nix can you clarify your comment? What qualifies as a ‘correct’ Sender attribute?

    Moderator Marius L. J.

    (@clorith)

    Hiya,

    Just letting you all know we’ve identified the cause for emails failing on some server setups, and it’s being tracked over at https://core.trac.www.ads-software.com/ticket/37736 (yup, the trick from Stack Overflow does work and is actually the likely solution ?? )

    sebannei68

    (@sebannei68)

    Hello
    I have read your topic and i have the same issue like here :

    Here my code :

    $body = “test”;
    $headers[] = ‘Content-Type: text/html; charset=UTF-8’ . “\r\n”;
    $headers[] = “From: L’XXXX <contact@mywebsite>” . “\r\n”;

    add_filter( ‘wp_mail_content_type’, ‘set_content_type’ );
    function set_content_type( $content_type ) {
    return ‘text/html’;
    }
    $to = EMAIL of customer;
    $subject=”test”;

    return wp_mail( $to, $subject, $body, $headers );

    sebannei68

    (@sebannei68)

    I have done all things you do here … but same issue :s

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘wp_mail doesn't work after update to 4.6’ is closed to new replies.