Moderators Kyle Posted October 9, 2011 Moderators Report Posted October 9, 2011 Hey All, I'm trying to figure out how can I make this code into multiple emails. I want it to send to different people. $email = 'whois@email.com'; How can I make this line of code into sending an email to multiple email? Any help would be great! Thanks! Quote
bunoire14 Posted October 9, 2011 Report Posted October 9, 2011 Hi, Could you accept an array of proposed email addresses and loop through them assigning them to $email and do something with them at the same time? something like: foreach ($address as $email) { Do Your Stuff... Send Email etc... } Just a suggestion, I am assuming you mean you want to send a single email to multiple addresses? Cheers, Hey All, I'm trying to figure out how can I make this code into multiple emails. I want it to send to different people. $email = 'whois@email.com'; How can I make this line of code into sending an email to multiple email? Any help would be great! Thanks! 1 Quote
Moderators Kyle Posted October 10, 2011 Author Moderators Report Posted October 10, 2011 Sorry, I'm still sucky at arrays right now. How would I make it work? Thanks Quote
Guest lorathon Posted October 10, 2011 Report Posted October 10, 2011 the list of emails would need to be placed in the $email array. Example $pilots = PilotData::findPilots(array('retired' => 0)); //Retrieves an array of pilots who have a retired column of ZERO // Loop through the array foreach($pilots as $pilot) { $email = $pilot->email; // Do stuff with the email address here (example follows) $subject = 'Subject of the email'; $message = 'The main message of the email'; Util::SendEmail($email, $subject, $message); } Quote
Moderators Kyle Posted October 10, 2011 Author Moderators Report Posted October 10, 2011 Thanks for your help guys! Rep given! Quote
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.