PHP Bulk Query WordPress message user e-mail address implementation method, WordPress message
Today received a lot of Bloger friends e-mail message, hey, I feel very fun, but they are how to achieve this, very simple, but the simple is divided into two steps:
1) Get e-mail address via SQL query
2) Mass e-mail by some means
For 1, several lines of PHP code can be resolved:
Copy the Code code as follows:
<>
xmlns= "http://www.w3.org/1999/xhtml" >
WordPress Mail Bulk tool designed by Kaisir
<?php
The database address to connect to
$db _server= "localhost";
Database user Name
$db _user_name= "Change this to your database username";
Database Password
$db _user_password= "Change this to your database password";
Database name
$db _name= "Change to your database name here";
Please do not modify the following code
$sql = "Select DISTINCT comment_author_email from ' blog_comments ' WHERE 1";
$conn =mysql_connect ($db _server, $db _user_name, $db _user_password);
if (! $conn)
{
Echo
Database connection Failed! Please check your username and password!
";
Exit (0);
}
$flag =mysql_select_db ($db _name, $conn);
if (! $flag)
{
Echo
The database connection is OK, but the specified database cannot be opened!
";
Exit (0);
}
Execute Query
$result =mysql_query ($sql, $conn);
while ($row =mysql_fetch_array ($result))
{
?>
<?echo $row ["Comment_author_email"]?>
<?php
}
Mysql_close ($conn);//Close database connection
?>
For 2, this is more troublesome ... Because so big data volume of mail any one email service provider will put you off, so the best way is to build their own SMTP server, or use mass tools, hey, this is by everyone's own Google good:)
http://www.bkjia.com/PHPjc/958720.html www.bkjia.com true http://www.bkjia.com/PHPjc/958720.html techarticle PHP Bulk Query wordpress message user e-mail address implementation method, WordPress message today received a lot of Bloger friends e-mail message, hey, I feel very fun, but they are how ...