[wp-trac] [WordPress Trac] #64368: `Could not instantiate mail function` errors sending mail in 6.9

WordPress Trac noreply at wordpress.org
Sat Dec 6 01:39:33 UTC 2025


#64368: `Could not instantiate mail function` errors sending mail in 6.9
---------------------------+-----------------------
 Reporter:  desrosj        |       Owner:  SirLouen
     Type:  defect (bug)   |      Status:  accepted
 Priority:  normal         |   Milestone:  6.9.1
Component:  Mail           |     Version:  6.9
 Severity:  normal         |  Resolution:
 Keywords:  needs-testing  |     Focuses:
---------------------------+-----------------------

Comment (by siliconforks):

 Replying to [comment:5 digitalblanket]:
 > It sounds like we should be setting $phpmailer->From and
 $phpmailer->Sender now to overcome this?

 I think the best thing to do in your case would be to use the
 `wp_mail_from` filter.  The intended behavior in WordPress 6.9 is that, if
 you use the `wp_mail_from` filter, then there should be no need to set the
 `$phpmailer->From` and `$phpmailer->Sender` values.

 If you don't use the `wp_mail_from` filter - then yes, you're right, if
 you're setting `$phpmailer->From` manually then you should probably also
 be setting `$phpmailer->Sender` too.

 > If so that's a massive change which is not at all explained in the WP
 6.9 changelog!

 Well, https://make.wordpress.org/core/2025/11/18/more-reliable-email-in-
 wordpress-6-9/ does mention the change in behavior and suggest using the
 `wp_mail_from` filter.  But obviously this change is causing issues for
 some people, so it's possible it might simply be reverted in a future
 bugfix release.  But even if the change gets reverted, you may still want
 to set `$phpmailer->Sender`, to make sure your emails are getting sent
 with a sensible envelope sender value.

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


More information about the wp-trac mailing list