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

WordPress Trac noreply at wordpress.org
Fri Dec 5 17:10:15 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:
---------------------------+-----------------------
Changes (by SirLouen):

 * owner:  (none) => SirLouen
 * status:  new => accepted


Comment:

 After some research I've gotten to a conclusion: The problem falls into
 Sendmail software

 If `sendmail_from` is set at the same time as `-f`, Sendmail blows.

 The logic of PHPMailer is not helping either. If the `Sender` is enabled,
 it will add a `sendmail_from` making Sendmail blow.

 This behavior is not occurring in the rest of the mail servers. I have
 tested with Sendmail up to `8.17.1`, not the latest 8.18.1.

 According to their changelog, I'm not 100% sure
 https://ftp.sendmail.org/RELEASE_NOTES
 If they have solved this here

 {{{
 VACATION: Add support for Return-Path header to set sender
                 to match OpenBSD and NetBSD functionality.
 }}}

 Because, to be 100% sincere, I'm not sure what `sendmail_from` is
 literally doing. I will need to dig a bit on the PHP code before getting
 to a conclusion.

 For now, the only solution for people under these circumstances, is to
 force set `->Sender` to empty as @siliconforks commented

 {{{#!php
 <?php
 function use_no_sender( $phpmailer ) {
    $phpmailer->Sender = "";
 }

 add_action( 'phpmailer_init', 'use_no_sender' );
 }}}

 I will report back when I have more data. For now all I can say is that
 this is not an intrinsic problem of WP itself. Maybe some changes could
 happen in PHPMailer in the coming days.

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


More information about the wp-trac mailing list