ironman Posted April 12, 2010 Share Posted April 12, 2010 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 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' ; Quote Link to comment https://forums.phpfreaks.com/topic/198328-phpmail-multiple-recipients/ Share on other sites More sharing options...
premiso Posted April 13, 2010 Share Posted April 13, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/198328-phpmail-multiple-recipients/#findComment-1040631 Share on other sites More sharing options...
ironman Posted April 13, 2010 Author Share Posted April 13, 2010 Nope, makes sense. Had to read it over a few times, but it makes sense. The period is what was getting me. Thanks a lot! Quote Link to comment https://forums.phpfreaks.com/topic/198328-phpmail-multiple-recipients/#findComment-1040633 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.