• Resolved axew3

    (@axewww)


    On a test localhost, where apache 2.4 and php 5.6.. are installed, I’ve think in first, were an error on plugins installed on wp as test, maybe something on wp_w3all plugin. Disabled all plugins, nothing. Reinstalled a new 4.6 … nothing, no email is send out, also if php mail log file report correctly this:

    [26-Aug-2016 22:10:19 UTC] mail() on [F:\HTDOCS\ROOT_INTEGRATIONS\wordpress\wp-includes\class-phpmailer.php:677]: To: [email protected] -- Headers: Date: Fri, 26 Aug 2016 22:10:19 +0000 From: axew <wordpress@localhost> Reply-To: "\"[email protected]\"" <[email protected]> Message-ID: <8fce4f82facb168edc150c6d59f4af00@localhost> X-Mailer: PHPMailer 5.2.14 (https://github.com/PHPMailer/PHPMailer) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit
    [26-Aug-2016 22:11:14 UTC] mail() on [F:\HTDOCS\ROOT_INTEGRATIONS\wordpress\wp-includes\class-phpmailer.php:677]: To: [email protected] -- Headers: Date: Fri, 26 Aug 2016 22:11:14 +0000 From: axew <wordpress@localhost> Reply-To: "\"[email protected]\"" <[email protected]> Message-ID: <cfa75915dd6435213641910a1dc888c8@localhost> X-Mailer: PHPMailer 5.2.14 (https://github.com/PHPMailer/PHPMailer) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit
    [27-Aug-2016 16:20:47 UTC] mail() on [F:\HTDOCS\wp46\wp-includes\class-phpmailer.php:677]: To: [email protected] -- Headers: Date: Sat, 27 Aug 2016 16:20:47 +0000 From: WordPress <wordpress@localhost> Message-ID: <24af1200a426f7a25e35e8c69d482f1a@localhost> X-Mailer: PHPMailer 5.2.14 (https://github.com/PHPMailer/PHPMailer) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit

    All emails seem to be correctly send out, but nothing will never arrive. On WP 4.6.

    Finally i’ve reinstall WP 4.5 to test out it: on it work well. And the log file returned is the same, without php errors.
    Any idea what can be the problem?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter axew3

    (@axewww)

    [read the post after]

    $cc and $bcc have been lost on 4.6 pluggable.php

    File: wp_includes/pluggable.php

    pluggable.php on 4.5 WP vers, lines 230,231

    $cc = array();
    $bcc = array();

    that are missed on 4.6
    pluggable.php On 4.6: line 231
    $headers = array();
    i’ve so re-add immediately after as on 4.5:

    $cc = array();
    $bcc = array();

    The WP 4.6 on Win and Apache now work.
    But still there is a problem: email is send out only to user on register (that i’ve just test), not admin. I can see to solve the thing but i know somebody else now can do a better, and fast work, to maybe fix this.

    I’ve lost time to see inside wrong file last time (the mailer lib file).

    Thread Starter axew3

    (@axewww)

    sorry, i’ve think this was the problem, instead, it return to work when the pluggable.php of 4.6 is replaced by the pluggable.php of 4.5 entirely.
    So i need to check why the problem come out and wht wrong on pluggable.php of 4.6.
    As above, maybe someone else can do it in a better and fast way.

    Thread Starter axew3

    (@axewww)

    I’ve just replace only the wp_mail function on pluggable.php of 4.6,
    with the wp_mail function of 4.5.
    Now all work as expected, and emails have been correctly send out to both user and admin on register.

    Thread Starter axew3

    (@axewww)

    between a fast aperitivo and something else, i return to pc and:
    pluggable.php on 4.6
    line 365

    foreach ( $address_headers as $address_header => $addresses ) {
    		if ( empty( $addresses ) ) {
    			continue;
    		}

    if ( empty( $addresses ) ) {
    return true so email will never be sent?

    Thread Starter axew3

    (@axewww)

    Ok, let all the above, nothing is empty, on the foreach i was checking the last instance that of course was empty. So sorry for the confusion.

    Now all is more clear:
    on WP 4.6 pluggable.php:
    line 352:
    $phpmailer->setFrom( $from_email, $from_name );
    i see … if i comment out the line all work ok:
    //$phpmailer->setFrom( $from_email, $from_name );
    so after all, a single line have solve the problem.
    Now emails have been sent out: unique problem is that email are coming from user root@localhost, instead than wordpress@localhost.
    Any idea now!?

    Thread Starter axew3

    (@axewww)


    Instead to comment out line 352
    $phpmailer->setFrom( $from_email, $from_name );
    adding just before it .com (for example):
    $from_email = $from_email . '.com';
    Emails to admin and user are sent correctly. All is working.
    Seem that if the email address contain .com it is processed ok, if email do not contain .com will be never processed.
    Hard night at moment, i will return over this as i can. Any help?

    Thread Starter axew3

    (@axewww)

    Morning to all the mad world.

    To finish at moment, what i’ve get finally for sure
    on WP 4.6, win OS apache server test:

    pluggable.php
    $phpmailer->setFrom( $from_email, $from_name );
    change with
    $phpmailer->setFrom( $from_email, $from_name, false );
    it work on 4.6.

    public function setFrom() of class-phpmailer.php, the value of $this->Sender is empty infact this code on it:

    if ($auto) {
                if (empty($this->Sender)) {
                    $this->Sender = $address;
                }
            }

    is executed, and to $this->Sender will be assigned the value of $address (that is wordpress@localhost). Should be ok, but it lead to that emails aren’t sent if the email isn’t completely well formed. adding $from_email = $from_email . '.com' before $phpmailer->setFrom call on pluggable.php work ok.
    also the change to $phpmailer->setFrom( $from_email, $from_name, false ); the line code as above mentioned in function wp_mail of pluggable.php, work ok
    in this case $this->Sender = $address; on setFrom() isn’t executed and all work ok. Email are sent.
    Both solutions resolve the problem, this let me (maybe) think to:
    a following check of passed email address, if it is not well formed, lead to fail on sending out emails.
    if we use $phpmailer->setFrom( $from_email, $from_name, false );
    the $this->Sender = $address; isn’t executed, not assigning a value at this point to $this->Sender and also this resolve the problem.

    Hope this will help somebody else to fix, and that 4.6>
    will resolve the problem. I will try to go more deep as i can, but it seem to me very strange behavior that i’ve not still completely well understand.
    I will return over as ever, as i can.

    Thread Starter axew3

    (@axewww)

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Win OS Apache server: no email sent on WP 4.6’ is closed to new replies.