Reputation: 456
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.
Upvotes: 12
Views: 12455
Reputation: 1251
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"
Upvotes: 26
Reputation: 1497
I've not done it with reply-to, but if it works the same as CC, then doing it like this should be possible.
$headers .= "Reply-To: [email protected],[email protected]\r\n"
Upvotes: 0