[wp-trac] [WordPress Trac] #37881: Win OS Apache 2.4 Php 5.6.. : WP 4.6 no email sent

WordPress Trac noreply at wordpress.org
Tue Aug 30 13:15:08 UTC 2016


#37881: Win OS Apache 2.4 Php 5.6.. : WP 4.6 no email sent
--------------------------+------------------------
 Reporter:  axewww        |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Mail          |     Version:  4.6
 Severity:  normal        |  Resolution:  duplicate
 Keywords:                |     Focuses:
--------------------------+------------------------
Description changed by SergeyBiryukov:

Old description:

> On a test win localhost, where apache 2.4 and php 5.6.. are installed,
> I've think in first, were an error on plugins installed. Disabled all
> plugins, nothing. No email sent on 4.6. Reinstalled a new 4.6 ...
> nothing, no email is send out, also if php mail log file report correctly
> email has been sent:
>
> {{{
> [26-Aug-2016 22:10:19 UTC] mail() on
> [F:\HTDOCS\ROOT_INTEGRATIONS\wordpress\wp-includes\class-
> phpmailer.php:677]: To: me at w3it.org -- Headers: Date: Fri, 26 Aug 2016
> 22:10:19 +0000 From: axew <wordpress at localhost> Reply-To:
> "\"me at axew3.com\"" <me at axew3.com> Message-ID:
> <8fce4f82facb168edc150c6d59f4af00 at 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: you at mysite.org -- Headers: Date: Fri, 26 Aug 2016
> 22:11:14 +0000 From: axew <wordpress at localhost> Reply-To:
> "\"me at axew3.com\"" <me at axew3.com> Message-ID:
> <cfa75915dd6435213641910a1dc888c8 at 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 sent 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, the same, ever without php errors.
> 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 will make return work email onregister (that i've test out) on 4.6.
>
> ''public function setFrom()'' of ''class-phpmailer.php'', the value of
> ''$this->Sender'' is empty and this code on it:
>
> {{{#!php
> <?php
> if ($auto) {
>             if (empty($this->Sender)) {
>                 $this->Sender = $address;
>             }
>         }
> }}}
>

> is executed, so to ''$this->Sender'' will be assigned the value of
> ''$address'' (that is ''wordpress at localhost''). Should be ok, but it lead
> to that emails aren't sent if the email isn't completely well formed. In
> fact adding
>
> {{{
> $from_email = $from_email . '.com'
> }}}
>
> just before ''$phpmailer->setFrom'' call on ''pluggable.php'' work ok.
> also other solution
>
> {{{
> $phpmailer->setFrom( $from_email, $from_name, false );
> }}}
>
> get wp 4.6 email work ok in the server i test this behavior on.
> 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 email address, if it is not well formed, lead to
> fail on sending out emails.
>

> I've see hints on pluggable:
> ''      /* If we don't have an email from the input headers default to
> wordpress@$sitename
>          * Some hosts will block outgoing mail from this address if it
> doesn't exist but
>          * there's no easy alternative. Defaulting to admin_email might
> appear to be another
>          * option but some hosts may refuse to relay mail from an unknown
> domain. See
>          * https://core.trac.wordpress.org/ticket/5007.
>          */''

New description:

 On a test win localhost, where apache 2.4 and php 5.6.. are installed,
 I've think in first, were an error on plugins installed. Disabled all
 plugins, nothing. No email sent on 4.6. Reinstalled a new 4.6 ... nothing,
 no email is send out, also if php mail log file report correctly email has
 been sent:

 {{{
 [26-Aug-2016 22:10:19 UTC] mail() on
 [F:\HTDOCS\ROOT_INTEGRATIONS\wordpress\wp-includes\class-
 phpmailer.php:677]: To: me at w3it.org -- Headers: Date: Fri, 26 Aug 2016
 22:10:19 +0000 From: axew <wordpress at localhost> Reply-To:
 "\"me at axew3.com\"" <me at axew3.com> Message-ID:
 <8fce4f82facb168edc150c6d59f4af00 at 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: you at mysite.org -- Headers: Date: Fri, 26 Aug 2016
 22:11:14 +0000 From: axew <wordpress at localhost> Reply-To:
 "\"me at axew3.com\"" <me at axew3.com> Message-ID:
 <cfa75915dd6435213641910a1dc888c8 at 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 sent 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, the same, ever without php errors.
 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 will make return work email onregister (that i've test out) on 4.6.

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

 {{{#!php
 <?php
 if ($auto) {
             if (empty($this->Sender)) {
                 $this->Sender = $address;
             }
         }
 }}}


 is executed, so to ''$this->Sender'' will be assigned the value of
 ''$address'' (that is ''wordpress at localhost''). Should be ok, but it lead
 to that emails aren't sent if the email isn't completely well formed. In
 fact adding

 {{{
 $from_email = $from_email . '.com'
 }}}

 just before ''$phpmailer->setFrom'' call on ''pluggable.php'' work ok.
 also other solution

 {{{
 $phpmailer->setFrom( $from_email, $from_name, false );
 }}}

 get wp 4.6 email work ok in the server i test this behavior on.
 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 email address, if it is not well formed, lead to fail
 on sending out emails.


 I've see hints on pluggable:
 {{{
         /* If we don't have an email from the input headers default to
 wordpress@$sitename
          * Some hosts will block outgoing mail from this address if it
 doesn't exist but
          * there's no easy alternative. Defaulting to admin_email might
 appear to be another
          * option but some hosts may refuse to relay mail from an unknown
 domain. See
          * https://core.trac.wordpress.org/ticket/5007.
          */
 }}}

--

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37881#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list