• Resolved doume

    (@doume)


    Hello,

    MOU V5.4.9 does not send emails.

    After some debug I found out that the way $from is now constructed makes wp_mail_failed trigger on the setFrom field.

    [errors] => Array
            (
                [wp_mail_failed] => Array
                    (
                        [0] => Invalid address:  (setFrom) <server name here>
                    )
    
            )

    It happens whatever the server name (simple localhost, hosted primary domain, hosted sub domain).

    WP4.9.1 + LAMP PHP 7.1.9 – hosted primary domain
    WP4.9.1 + LAMP PHP 5.6.31 – hosted sub domain
    WP4.9.1 + LAMP PHP 7.2.0 – local dev localhost

    Current applied workaround :
    wp_mail($this->mailonupdate_listOfCommaSeparatedRecipients(), $subject, $message, $headers);
    replaced by
    ‘$MailResult = wp_mail($this->mailonupdate_listOfCommaSeparatedRecipients(), $subject, $message, $headers);

    if ($MailResult != true) { // Rollback to V5.4.8 method
    $sender = ‘WordPress@’ . preg_replace(‘#^www\.#’, ”, strtolower($_SERVER[‘SERVER_NAME’]));
    $from = “From: \”$sender\” <$sender>”;
    $headers = “$from\n” . “Content-Type: text/plain; charset=\”” . get_option(‘blog_charset’) . “\”\n”;

    $MailResult = wp_mail($this->mailonupdate_listOfCommaSeparatedRecipients(), $subject, $message, $headers);
    }`

    D.

    • This topic was modified 6 years, 11 months ago by doume.
    • This topic was modified 6 years, 11 months ago by doume.
    • This topic was modified 6 years, 11 months ago by doume.
    • This topic was modified 6 years, 11 months ago by doume.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘V5.4.9: wp_mail_failed triggered on Invalid address: (setFrom)’ is closed to new replies.