[wp-trac] [WordPress Trac] #46217: wp_mail() not sending messages on PHP7.3.x

WordPress Trac noreply at wordpress.org
Thu Nov 21 08:10:30 UTC 2019


#46217: wp_mail() not sending messages on PHP7.3.x
---------------------------+------------------------------
 Reporter:  whatevs        |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Mail           |     Version:  5.0.3
 Severity:  major          |  Resolution:
 Keywords:  needs-testing  |     Focuses:
---------------------------+------------------------------

Comment (by netzgestaltung):

 Hi, i also do have this issue:

 With PHP 7.3 on, this test script at page.php fails:
 {{{#!php
 <?php

     if ( $_GET['testmail'] === "1" ) {
       ini_set( 'display_errors', 1 );
       error_reporting( E_ALL );

       // define the wp_mail_failed callback
       function action_wp_mail_failed($wp_error){
         echo var_dump($wp_error);
       }
       add_action('wp_mail_failed', 'action_wp_mail_failed', 10, 1);

       $from = "wordpress at alphabetisierung.at";
       $recipient = "listing at majors-welt.net";
       $subject = "PHP Mail Test script";
       $body = "This is a test to check the PHP Mail functionality";
       $headers = "From: " . $from . "\r\n";
       $mail = wp_mail( $recipient, $subject, $body, $headers );
       if ( $mail ) {
         wp_die('mail sendt');
       } else {
         wp_die('mail not sendt');
       }
     }
 }}}


 {{{
 object(WP_Error)#10509 (2) {
   ["errors"]=>
   array(1) {
     ["wp_mail_failed"]=>
     array(1) {
       [0]=>
       string(57) "Invalid address:  (setFrom)
 wordpress at alphabetisierung.at"
     }
   }
   ["error_data"]=>
   array(1) {
     ["wp_mail_failed"]=>
     array(6) {
       ["to"]=>
       array(1) {
         [0]=>
         string(23) "listing at majors-welt.net"
       }
       ["subject"]=>
       string(20) "PHP Mail Test script"
       ["message"]=>
       string(50) "This is a test to check the PHP Mail functionality"
       ["headers"]=>
       array(0) {
       }
       ["attachments"]=>
       array(0) {
       }
       ["phpmailer_exception_code"]=>
       int(0)
     }
   }
 }
 }}}


 When switching the servers PHP version to 7.2-latest the email gets send

 WP: 5.3–de_DE

 kind regards
 tom

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


More information about the wp-trac mailing list