Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Email Reply to multiple email addresses

Tags:

php

I want to send email reply to multiple email addresses. Actually there are more then one admins and i want that all of these should receive email reply. Right now i am using this

$headers .= "Reply-To: ". [email protected] . "\r\n";

It is working fine for one email address but i do not know how i can implement this for multiple email addresses. Actually i have an array of email addresses that are separated with commas and i want that all of these should receive email reply. How i can implement this ? Your help will be much appreciated.

like image 469
wpdd Avatar asked Feb 16 '18 02:02

wpdd


People also ask

How do you reply to multiple recipients in an email?

Reply All is when you respond to everyone on the thread. Other recipients will see a message you Reply All to, whether they're in the "To" or "Cc" fields.

Can you send an email to multiple recipients by separating the addresses with a?

If you have a multiple recipient list, you can separate each address with a comma, semicolon, space or by pressing the enter key. Now, compose your new message and then select the Message tab and click the Send button.


1 Answers

The RFC5322 says:

In either case, an optional reply-to field MAY also be included, which contains the field name "Reply-To" and a comma-separated list of one or more addresses.

So, all you need to do is implode that array of yours into a comma-separated list.

$emails = array ( "[email protected]", "[email protected]", "[email protected]");
$str = implode (",", $emails); //[email protected],[email protected],[email protected]
$headers .= "Reply-To: $str\r\n"
like image 124
gmslzr Avatar answered Oct 22 '22 03:10

gmslzr