Title: Multiple addresses
Last modified: August 30, 2016

---

# Multiple addresses

 *  Resolved [McCage](https://wordpress.org/support/users/mccage/)
 * (@mccage)
 * [11 years ago](https://wordpress.org/support/topic/multiple-addresses-1/)
 * Hi,
    I use the User Submitted Posts Plugin and it works perfectly but I did not
   receive notification emails. The Postman SMTP Plugin solved that problem for 
   me when I use only 1 notification address. When I give in 2 addresses (client
   and administrator) no notification emails are received. I cannot see if the cause
   of this is in the Postman or the USP Plugin. USP says it is possible to give 
   in multiple addresses divided by a comma. I also tried with ; Could the problem
   be in USP or is it really capable to handle multiple addresses? Site: [http://www.edithdezwart.nl](http://www.edithdezwart.nl)
   but under construction at the time of writing this support question.
 * [https://wordpress.org/plugins/user-submitted-posts/](https://wordpress.org/plugins/user-submitted-posts/)

Viewing 15 replies - 1 through 15 (of 34 total)

1 [2](https://wordpress.org/support/topic/multiple-addresses-1/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/multiple-addresses-1/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/multiple-addresses-1/page/2/?output_format=md)

 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [11 years ago](https://wordpress.org/support/topic/multiple-addresses-1/#post-6337150)
 * Yes, User Submitted Posts works with multiple email addresses. It could be that
   another plugin or theme script is interfering with normal functionality. You 
   can verify by temp disabling all other plugins or setting up a test WP install
   running only USP.
 *  Thread Starter [McCage](https://wordpress.org/support/users/mccage/)
 * (@mccage)
 * [11 years ago](https://wordpress.org/support/topic/multiple-addresses-1/#post-6337186)
 * Dear Jeff,
    I am sorry to say I disagree. I tried USP with only the USP and Postman
   Plugins and still there was no notification of USP messages as I could see in
   the Postman email log. I even tried several standard WordPress themes with the
   same result. But no problem; I found a workaround in the possibility in Postman
   to add a CC address to every mail sent by the WordPress installation. So again:
   compliments for this really complete product and thanks for support!
 *  [Jason Hendriks](https://wordpress.org/support/users/jasonhendriks/)
 * (@jasonhendriks)
 * [11 years ago](https://wordpress.org/support/topic/multiple-addresses-1/#post-6337190)
 * [@specialk](https://wordpress.org/support/users/specialk/), I agree with McCage,
   _User Submitted Posts_ mangles the From address which some SMTP servers will 
   reject.
 *     ```
       From: WordPress <test1@hendriks.ca test2@hendriks.ca>
       Sender: test0@hendriks.ca
       To: test1@hendriks.ca,
        test2@hendriks.ca
       Reply-To: WordPress <test1@hendriks.ca test2@hendriks.ca>
       Subject: WordPress: New user-submitted post!
       ```
   
 * As you can see, the **From** and **Reply-To** headers are no longer valid when
   multiple recipients are configured in _User Submitted Posts_.
 * Here are the original wp_mail parameters from USP:
 *     ```
       [18-Jul-2015 14:20:17 UTC] DEBUG PostmanMessage: Processing other Header - MIME-Version: 1.0
       [18-Jul-2015 14:20:17 UTC] DEBUG PostmanMessage: Processing From Header - From: WordPress <test1@hendriks.ca, test2@hendriks.ca>
       [18-Jul-2015 14:20:17 UTC] DEBUG PostmanMessage: Processing Reply-To Header - Reply-To: WordPress <test1@hendriks.ca, test2@hendriks.ca>
       [18-Jul-2015 14:20:17 UTC] DEBUG PostmanMessage: Processing Return-Path Header - Return-Path: test1@hendriks.ca, test2@hendriks.ca
       [18-Jul-2015 14:20:17 UTC] WARN  PostmanMessage: Ignoring Return-Path header 'test1@hendriks.ca, test2@hendriks.ca'
       [18-Jul-2015 14:20:17 UTC] DEBUG PostmanMessage: Processing Content-Type Header - Content-Type: text/plain; charset="UTF-8"
       [18-Jul-2015 14:20:17 UTC] DEBUG PostmanMessage: User added recipient: "test1@hendriks.ca"
       [18-Jul-2015 14:20:17 UTC] DEBUG PostmanMessage: User added recipient: "test2@hendriks.ca"
       ```
   
 * The problem with USP is here:
 *     ```
       $headers .= "From: $blog <$to>\n";
       $headers .= "Reply-To: $blog <$to>\n";
       ```
   
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [11 years ago](https://wordpress.org/support/topic/multiple-addresses-1/#post-6337192)
 * Jason, do you have any recommendations for more correct mail headers? I’m not
   an expert in email stuff – just know what works on my own server, which has no
   problems with the headers sent by USP. If you want to suggest an improvement,
   I would be glad to check it out and implement. Thanks.
 *  [Jason Hendriks](https://wordpress.org/support/users/jasonhendriks/)
 * (@jasonhendriks)
 * [11 years ago](https://wordpress.org/support/topic/multiple-addresses-1/#post-6337199)
 * 1. You can have only one address in a From header. Change
 * `From: WordPress <test1@hendriks.ca, test2@hendriks.ca>`
 * to
 * `From: WordPress <test1@hendriks.ca>`
 * 2. Since your Reply-To header is the same as the from header, there is no need
   to set it.
 * 3. Since your Content-Type is plain, you shouldn’t be setting the MIME-Version
   header.
 * 4. Setting the Return-Path header is an RFC violation, don’t set it.
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [11 years ago](https://wordpress.org/support/topic/multiple-addresses-1/#post-6337201)
 * Sweet thanks. Will try to verify these suggestions and implement next update.
   Cheers.
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/multiple-addresses-1/#post-6337319)
 * Hey Jason,
 * I’ve been looking further into this, but cannot locate where in the RFC it says
   that setting the Return-Path header is a violation.
 * Do you have some reference to official documentation?
 *  [Jason Hendriks](https://wordpress.org/support/users/jasonhendriks/)
 * (@jasonhendriks)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/multiple-addresses-1/#post-6337320)
 * [http://stackoverflow.com/a/1782730](http://stackoverflow.com/a/1782730)
    [http://www.ietf.org/rfc/rfc2821.txt](http://www.ietf.org/rfc/rfc2821.txt)
   [https://tools.ietf.org/html/rfc5321](https://tools.ietf.org/html/rfc5321)
 * Page 58 of 5321
 *     ```
       A message-originating SMTP system SHOULD NOT send a message that
          already contains a Return-path header field.  SMTP servers performing
          a relay function MUST NOT inspect the message data, and especially
          not to the extent needed to determine if Return-path header fields
          are present.  SMTP servers making final delivery MAY remove Return-
          path header fields before adding their own.
       ```
   
 * I’ve seen a case where a mail server actually rejected a message with a return-
   path instead of just removing the header. Probably because return-path [back scatter](https://en.m.wikipedia.org/wiki/Backscatter_(email))
   is a form of Spam.
 * Both my SMTP plugin, and more recent versions of PHPMailer, strip the Return-
   Path header.
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/multiple-addresses-1/#post-6337321)
 * Okay, that makes sense, but it raises some questions/concerns:
 * 1) Is all mail sent via PHP considered SMTP?
 * 2) In my tests, the return-path header often specifies an email address that 
   doesn’t exist
 * 3) The return-path header for many sites includes the server admin username, 
   for example, [adminusername@example.com](https://wordpress.org/support/topic/multiple-addresses-1/adminusername@example.com?output_format=md)
 * I’ve already removed the return-path header from all of my plugins, and would
   appreciate any input/advice you could offer for these points. Thank you.
 *  [Jason Hendriks](https://wordpress.org/support/users/jasonhendriks/)
 * (@jasonhendriks)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/multiple-addresses-1/#post-6337322)
 * > Is all mail sent via PHP considered SMTP?
 * All mail is SMTP. SMTP is the protocol for sending mail on the Internet like 
   HTTP is the protocol for web pages.
 * PHP mail(), as I understand it, is just a wrapper for sendmail, and sendmail 
   is a primitive TCP app for sending a message to an SMTP server on localhost/port
   25.
 * > In my tests, the return-path header often specifies an email address that doesn’t
   > exist
 * Like the RFC says, the return-path header will always be set to the address in
   the [MAIL FROM](https://en.wikipedia.org/wiki/Bounce_address) command. Open relays
   won’t validate what this value is, in which case it certainly may not exist. 
   Other relays, like smtp.gmail.com, require the MAIL FROM to be a valid Gmail 
   email address.
 * If the final SMTP system can not make delivery, a bounce message is returned 
   to the Return-Path address, this is why the Wikipedia article calls the MAIL 
   FROM the bounce address.
 * > The return-path header for many WP sites includes the admin username, for example,
   > [adminusername@example.com](https://wordpress.org/support/topic/multiple-addresses-1/adminusername@example.com?output_format=md)
 * Because the message had this header:
 * From: [adminusername@example.com](https://wordpress.org/support/topic/multiple-addresses-1/adminusername@example.com?output_format=md)
 * I wrote an article that might help:
    [Contact Form emails won’t send with my Visitor’s Email Address](http://www.codingmonkey.ca/contact-form-emails-wont-send-with-my-visitors-email-address/)
 * Cheers! 🙂
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/multiple-addresses-1/#post-6337323)
 * Great stuff, thanks. Some follow ups:
 * “The return-path on a received email will always be the address in the original
   MAIL FROM command.”
 * So how to set the MAIL FROM command? Because as mentioned before, I am sending
   email alerts and setting the From header as [email@example.com](https://wordpress.org/support/topic/multiple-addresses-1/email@example.com?output_format=md).
   This is verified in the received message source. Even so, the Return-Path header
   specifies a completely different email, namely one that consists of the server
   admin username and the domain name, for example:
 * [adminusername@domainname.tld](https://wordpress.org/support/topic/multiple-addresses-1/adminusername@domainname.tld?output_format=md)
 * That is, your last point is incorrect (in general).
 *  [Jason Hendriks](https://wordpress.org/support/users/jasonhendriks/)
 * (@jasonhendriks)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/multiple-addresses-1/#post-6337324)
 * It depends on the software doing the sending. If you are using [Postman](https://wordpress.org/plugins/postman-smtp/),
   what you are seeing is expected because the user account (adminusername@domainname.
   tld) is used in the MAIL FROM regardless of what is set in the Message (email@
   example.com).
 * Example:
 *     ```
       220 mailtrap.io ESMTP ready
       EHLO localhost
       235 2.0.0 OK
       MAIL FROM:<web@hendriks.ca>
       250 2.1.0 Ok
       RCPT TO:<jane@hendriks.ca>
       250 2.1.0 Ok
       DATA
       354 Go ahead
       From: john <john@hendriks.ca>
       To: jane@hendriks.ca
       Subject: Postman SMTP Test (hendriks.ca)
       Date: Thu, 12 Nov 2015 04:00:16 +0000
       .
       250 2.0.0 Ok: queued
       ```
   
 * In the above example **web** is the account owner. **john** is the sender. **
   jane** is the recipient. the message will arrive with **web** as the return-path.
 * Google, for example, would **eat** the message if I tried to use a MAIL FROM 
   that did not match the email I authenticated with. This is to prevent [Spoofing](https://en.wikipedia.org/wiki/Email_spoofing).
   That’s why if you software uses the From header for your MAIL FROM, and you don’t
   own the From header, your email just vanishes.
 * > So how to set the MAIL FROM command?
 * Only the software actually talking to the SMTP server can do this. For WordPress,
   that means it is the responsibility of the SMTP plugin. The plugin composing 
   the message can not set it, nor should it, since it does not know the account
   details.
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/multiple-addresses-1/#post-6337325)
 * Okay that makes sense, thanks.
 * So as far as my question is concerned, basically you’re saying that using only
   PHP mail() it is not possible to set the Return-Path header, and that in order
   to do so an entire SMTP library must be used, correct? (like SwiftMailer or similar)
 *  [Jason Hendriks](https://wordpress.org/support/users/jasonhendriks/)
 * (@jasonhendriks)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/multiple-addresses-1/#post-6337326)
 * Yes.
 * PHP mail() was made for a world without email threats like Spam and Phishing.
   It’s great for jason@localhost to jeff@localhost.
 * It supports none of the technologies for combatting Internet email threats: SMTPS,
   STARTTLS, SASL, SPF, DKIM, DMARC.
 *  [Jason Hendriks](https://wordpress.org/support/users/jasonhendriks/)
 * (@jasonhendriks)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/multiple-addresses-1/#post-6337327)
 * PHPMail is the SMTP library that ships with WordPress. But out-of-the-box it 
   is in “PHP mail()” mode. [wordpress/wp-includes/class-phpmailer.php](https://github.com/WordPress/WordPress/blob/master/wp-includes/class-phpmailer.php),
   line 162.
 * i’m putting this thread in my ‘favourites’ now 🙂

Viewing 15 replies - 1 through 15 (of 34 total)

1 [2](https://wordpress.org/support/topic/multiple-addresses-1/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/multiple-addresses-1/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/multiple-addresses-1/page/2/?output_format=md)

The topic ‘Multiple addresses’ is closed to new replies.

 * ![](https://ps.w.org/user-submitted-posts/assets/icon-256x256.png?rev=2567685)
 * [User Submitted Posts – Enable Users to Submit Posts from the Front End](https://wordpress.org/plugins/user-submitted-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-submitted-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-submitted-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/user-submitted-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-submitted-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-submitted-posts/reviews/)

## Tags

 * [multiple](https://wordpress.org/support/topic-tag/multiple/)
 * [usp](https://wordpress.org/support/topic-tag/usp/)

 * 34 replies
 * 4 participants
 * Last reply from: [Ovidiu](https://wordpress.org/support/users/ovidiu/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/multiple-addresses-1/page/3/#post-6337346)
 * Status: resolved