nexuzkid Posted March 4, 2012 Share Posted March 4, 2012 Hello phpfreaks.com, ive been wondering all week howto do so. If i make a mysql_query and chooses all emails, i only get my own. But how can i choose all the users registered in the database`? best regards William Pfaffe Quote Link to comment https://forums.phpfreaks.com/topic/258260-howto-make-a-email-all-users-in-php/ Share on other sites More sharing options...
scootstah Posted March 4, 2012 Share Posted March 4, 2012 In the "to" parameter of the mail() function, you can separate emails with a comma to send multiple emails. Quote Link to comment https://forums.phpfreaks.com/topic/258260-howto-make-a-email-all-users-in-php/#findComment-1323837 Share on other sites More sharing options...
nexuzkid Posted March 4, 2012 Author Share Posted March 4, 2012 could you do a example? (not quite sure on the mail () function) and also that i want to mail every single user, without coding every single of their emails into the parameter. Quote Link to comment https://forums.phpfreaks.com/topic/258260-howto-make-a-email-all-users-in-php/#findComment-1323872 Share on other sites More sharing options...
scootstah Posted March 4, 2012 Share Posted March 4, 2012 http://us3.php.net/manual/en/function.mail.php You can use the implode function to condense an array into a string with separators. So this means you can take an array of emails (like what you would have if you got them from a database) and turn them into a string separated by commas which you can then plop into the mail function. Quote Link to comment https://forums.phpfreaks.com/topic/258260-howto-make-a-email-all-users-in-php/#findComment-1323890 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.