[resolved] [Plugin: Contact Form 7] Multiple recipient email addresses (11 posts)

  1. Gal Baras
    Posted 7 years ago #

    I've specified two email addresses (comma separated) as the recipients of a form's messages. The first one gets the message and the second gets nothing.

    The message is received with the two addresses listed in the "To:" header, separated by a comma, but the plugin only calls "wp_mail" for one recipient.

    Please code a loop, Miyoshi.

  2. Takayuki Miyoshi
    Posted 7 years ago #

    wp_mail() can accept comma separated addresses string for recipient. Loops are not necessary. So you should able to get it even on current version.

    If you don't receive messages to the second address, something might be blocking it.

  3. sevenof31
    Posted 7 years ago #

    In the TO field its not possible to add a second mail this results is an error on sending the form.

    I use CC: emailadress,secondadress,secondadress

  4. Gal Baras
    Posted 7 years ago #

    @takayukister, I've looked at wp_mail() (it's in wp-includes/pluggable.php) and it only calls "AddAddress()" once. $to is supposed to be an array for multiple recipients, so you would have to make it from the comma-separated list or it won't work (better than a loop, actually).

    @sevenof31, where in your Contact 7 form definition did you put those CC addresses? Please elaborate a bit more.

  5. Takayuki Miyoshi
    Posted 7 years ago #

    But I tested on my site and confirmed it worked. $phpmailer->AddAddress() can accept comma-separated string. It is treated correctly after that in MailSend() in wp-includes/class-phpmailer.php.

    Of course you can use Cc as well as To, though. It's new feature of version 1.10.

  6. themoonseeker
    Posted 7 years ago #

    @galbaras I think i have the same problem, my form is sent to first email but not to the second email. I tried with different email address : TO: address1, address2

    Something goes wrong!

  7. themoonseeker
    Posted 7 years ago #

    I tried Cc and doesnt work ..

    Additional headers
    Cc: address

    How can I resolve this problem?


  8. Gal Baras
    Posted 7 years ago #

    People, I'm embarrassed to say, but the reason my second email didn't seem to be getting through is because it was being ignored by the second recipient - 1shoppingcart.

    I've tested with two of my own addresses and it works fine.

    I've also test the Cc: in Additional Headers and got the message, so that's working too.

    Apologies, Miyoshi. You have coded well.

    @themoonseeker, make sure your WordPress blog is able to send emails (you can use the user registration process, for example), then grab a couple of successful addresses and test different combinations with them.


  9. scottbothel
    Posted 6 years ago #

    Glad you guys got it figured out, but I'm still stumped. Using WP-Mail-SMTP and trying a comma separated list of addresses in to and tried in the Cc headers as well.
    Tried: address1, address2
    Tried: address1,address2
    Sends to other addresses, but the second address is ignored. I need to copy to 6 addresses...(bad idea in my opinion anyways, but oh well)

    Plugin rocks, but I've never settled this one.

    Thanks anyone...

  10. charlls
    Posted 6 years ago #

    Just create an e-mail forward or distribution list. One e-mail address.

  11. TrishaM
    Posted 6 years ago #

    I can get it to send to multiple "To:" addresses, but I would like it to not display all the addresses on the To: line, so that the recipients do not know who else got the email.

    I don't want to do a blind mail, or use the cc: field.....

    Is it possible to send like this:

    To: John Doe, Joe Doe, Jane Doe

    And when John, Joe, and Jane each get the email, to only see their own name in the To field, and not the others?

Topic Closed

This topic has been closed to new replies.

About this Topic