[wp-trac] [WordPress Trac] #56500: WordPress sends email from a fixed address which will not work in my environment

WordPress Trac noreply at wordpress.org
Fri Sep 2 15:44:15 UTC 2022


#56500: WordPress sends email from a fixed address which will not work in my
environment
-----------------------------+-------------------------
 Reporter:  brivets          |       Owner:  (none)
     Type:  feature request  |      Status:  closed
 Priority:  normal           |   Milestone:
Component:  Mail             |     Version:  6.0.2
 Severity:  normal           |  Resolution:  worksforme
 Keywords:                   |     Focuses:
-----------------------------+-------------------------
Changes (by TimothyBlynJacobs):

 * status:  new => closed
 * resolution:   => worksforme
 * milestone:  Awaiting Review =>


Comment:

 Hi @brivets,

 Welcome to Trac!

 This is already possible by using the `wp_mail_from` and
 `wp_mail_from_name` filters. You can also work at a lower level by
 interacting with PHPMailer directly using the `phpmailer_init` action.

 {{{#!php
 add_filter( 'wp_mail_from', function () {
         return 'your at email.org';
 } );

 add_filter( 'wp_mail_from_name', function () {
         return 'Your Name';
 } );
 }}}

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


More information about the wp-trac mailing list