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 = 'first@one.com' , second@one.com';

 

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@hopethisworks.com' ;

Link to comment
Share on other sites

Try changing it to this:

 

$to = $row["email"] . ', email@hopethisworks.com' ;

 

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.