Jump to content

PHPmail - Multiple Recipients


ironman

Recommended Posts

Hello folks. I'm trying to add an additional recipient to an email generated by my system. I've done this successfully in the past by adding a comma after the first email, but in those situations everything was hard coded in. So for example I've done this, which seemed to work:

 

$to = '[email protected]' , [email protected]';

 

Now, however, I have a dynamic value and believe I can do it the same way, just want to run it by a few people before I do it. I'm not much of a PHP guy  :shy:

 

The code I want to manipulate is this:

$to = $row["email"];

 

I think I can do this: (Feed back is appreciated)

$to = $row["email"] , '[email protected]' ;

Link to comment
https://forums.phpfreaks.com/topic/198328-phpmail-multiple-recipients/
Share on other sites

Try changing it to this:

 

$to = $row["email"] . ', [email protected]' ;

 

The main issue is that you need to put the comma inside of the quotes (since it needs to be apart of the string) and you need to concatenate the $row['email'] (which is done with the period character) on to the string as well.

 

Let me know if this is confusing.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.