[wp-trac] [WordPress Trac] #49687: wp_mail() - Why is no envelope sender defined?

WordPress Trac noreply at wordpress.org
Sat Aug 9 16:37:25 UTC 2025


#49687: wp_mail() - Why is no envelope sender defined?
-------------------------------------+------------------------------
 Reporter:  vbbp                     |       Owner:  (none)
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Mail                     |     Version:  5.4
 Severity:  major                    |  Resolution:
 Keywords:  has-test-info has-patch  |     Focuses:
-------------------------------------+------------------------------

Comment (by SirLouen):

 The good thing here at least is that PHPMailer warns about the fact that
 you are completely screwing it and explains how you are screwing it (if
 they did some logging in #37736 and got this message we could have a
 reference).

 When you check the docs in PHPMailer, you can quickly see that the main
 maintainer is completely against using `mail`, and advocates for using a
 direct connection via SMTP. Theoretically, switching should be painless,
 according to him, but I'm not that sure. In practice, even if you are
 using a relayed configuration, you should have configured this in your
 localhost server, which should be listening to your localhost demands. So
 I can't quickly think of what could be the problem of switching to
 `isSMTP` (and all troubles like this would disappear instantly), but still
 trying to think of all the scenarios where `mail` could break is really
 weird, but still I believe we should be sticking to the correct way to do
 things.

 As you can see as an example of one of the messages you posted:

 > I am experiencing this bug with PHP 5.4.16 and Sendmail 8.14.7.
 > In php.ini I have sendmail_path defined with -f addr at domain.com, and I
 called mail() with -f in the 5th parameter.
 > My intent is to have -f defined in case I don't with mail(), and then
 override it as needed in mail()
 > Instead I get the error: more than one "from" person

 The person is doing things wrong. If they actually want to override the
 mail `-f` they should be using `mail.force_extra_parameters` not adding
 this to the `sendmail_path` and causing this double `From:`

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


More information about the wp-trac mailing list