Monk3h Posted October 29, 2008 Share Posted October 29, 2008 I am the owner of a text based RPG that I created my self. I have a databse for all the players info and a field for the email address. How would I go about creating something in PHP to send an email to every email in the players database? Im asking here first as I don’t want every one to get spammed by mails due to my errors. Thanks in advance, Jay. Link to comment https://forums.phpfreaks.com/topic/130548-php-e-mail/ Share on other sites More sharing options...
feidakila Posted October 30, 2008 Share Posted October 30, 2008 Suposing the players table name is 'players', and that the email field name is 'email' /* //connect to the database server and select the database to use, with these 2 methods $conection = mysql_connect(); $db = mysql_selectdb(); */ $query = "SELECT * FROM players" $res=msyql_query($query); while ($register = mysql_fetch_assoc($res)) { mail($register['email'], "subject", "content"); } Link to comment https://forums.phpfreaks.com/topic/130548-php-e-mail/#findComment-678329 Share on other sites More sharing options...
JasonLewis Posted October 30, 2008 Share Posted October 30, 2008 I would advise against the mail() function being used for bulk emailing. Have a look at PEAR::Mail which is more capable of sending lots of e-mails. Link to comment https://forums.phpfreaks.com/topic/130548-php-e-mail/#findComment-678346 Share on other sites More sharing options...
Monk3h Posted November 2, 2008 Author Share Posted November 2, 2008 Parse error: syntax error, unexpected T_VARIABLE Link to comment https://forums.phpfreaks.com/topic/130548-php-e-mail/#findComment-680704 Share on other sites More sharing options...
JasonLewis Posted November 3, 2008 Share Posted November 3, 2008 Was that a question? Link to comment https://forums.phpfreaks.com/topic/130548-php-e-mail/#findComment-680968 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.