[wp-trac] [WordPress Trac] #39360: wp_mail throws a phpmailerException when the sender address is incorrect

WordPress Trac noreply at wordpress.org
Wed Dec 21 09:55:20 UTC 2016


#39360: wp_mail throws a phpmailerException when the sender address is incorrect
--------------------------+-----------------------------
 Reporter:  xknown        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Mail          |    Version:  4.6.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The default implementation of `wp_mail` causes a PHP fatal due to an
 uncaught `phpmailerException` exception when the `From` address contains
 an invalid email address.
 I noticed this error while trying to install WP on a local ubuntu 16.04 VM
 with PHP 7.1 and the default nginx config (the WP dir was in
 `/var/www/html/wordpress/`).
 {{{
 server {
         listen 80 default_server;
         root /var/www/html;
         index index.php index.html index.htm index.nginx-debian.html;
         server_name _;
         location / {
                 try_files $uri $uri/ /index.php?$args;
         }
         location ~ \.php$ {
                 include snippets/fastcgi-php.conf;
                 fastcgi_pass unix:/run/php/php7.1-fpm.sock;
         }
 }
 }}}
 On the last install step, the VM http server responsed with a 500 error
 page --- the installation seems to have completed though. Here's the stack
 trace:
 {{{
 PHP message: PHP Fatal error:  Uncaught phpmailerException: Invalid
 address: wordpress at _ in /var/www/html/wordpress/wp-includes/class-
 phpmailer.php:946
 Stack trace:
 #0 /var/www/html/wordpress/wp-includes/pluggable.php(352):
 PHPMailer->setFrom('wordpress at _', 'WordPress', false)
 #1 /var/www/html/wordpress/wp-admin/includes/upgrade.php(395):
 wp_mail('alex at buayacorp....', 'New WordPress S...', 'Your new WordPr...')
 #2 /var/www/html/wordpress/wp-admin/includes/upgrade.php(98):
 wp_new_blog_notification('test', 'http://128.199....', 1, 'The password
 yo...')
 #3 /var/www/html/wordpress/wp-admin/install.php(375): wp_install('test',
 'alex', 'alex at buayacorp....', 1, '', '...', 'en_US')
 #4 {main}
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39360>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list