Jump to content

PHP E-mail


Monk3h

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

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