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

WordPress Trac noreply at wordpress.org
Fri Dec 12 13:56:59 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:  has-patch     |     Focuses:
--------------------------+-----------------------

Comment (by amanandhishoe):

 I think the problem is that WordPress should not be guessing how to format
 the Envelope. That is the responsibility of the sending email server.

 When WordPress uses PHP mail() / sendmail:
         •       it does not know which MTA is behind it (Sendmail,
 Postfix, Exim, wrapper)
         •       it does not know host-level flags (-f, rewriting rules)
         •       it does not know how the envelope is ultimately formed
         •       it does not see the SMTP transaction

 So WordPress cannot reason reliably about the envelope.

 What WordPress could verify safely:

 WordPress can perform DNS-based checks, because those are:
         •       read-only
         •       non-invasive
         •       independent of the host MTA
         •       already done elsewhere in core (updates, REST, loopback)

 Specifically, WordPress could check:

 SPF
         •       Does the site’s sending domain have an SPF record?
         •       Is it missing entirely?
         •       Is it +all / overly permissive?

 DKIM
         •       Is there any DKIM selector published for the domain?
         •       (Not whether it’s correct—just whether DKIM exists at
 all.)

 DMARC
         •       Is _dmarc.example.com present?
         •       Is it p=none, quarantine, or reject?

 These checks do not require sending mail and do not interfere with
 delivery.

 A Site Health notice like:

 “Your domain does not publish SPF, DKIM, or DMARC records. Emails sent
 from this site are likely to be rejected or spam-foldered.”

 is:
         •       accurate,
         •       understandable at a high level,
         •       actionable (with links),
         •       and far safer than silently changing mail behavior.

 It reframes the problem correctly:

 “Email reliability depends on DNS and a mail service.”

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


More information about the wp-trac mailing list