PHP batch query WordPress message recipient's E-mail address implementation method. PHP batch query of WordPress message body E-mail address implementation method this article mainly introduces PHP batch query of WordPress message body E-mail address implementation method. This article provides the implementation code directly, how to implement batch query of WordPress message recipient email addresses in PHP
This article mainly introduces the implementation of PHP batch query of the WordPress message body's E-mail address. This article provides the implementation code directly. For more information, see
Today, I received E-mail text messages from many Bloger friends. hey, it's fun. but how do they implement this? it's very simple, but there are two simple steps:
1) obtain the email address through SQL query
2) Send E-mails in batches in some way
For 1, several lines of PHP code can be solved:
The code is as follows:
Xmlns = "http://www.w3.org/1999/xhtml">
WordPress mass mailing tool Designed By Kaisir
// Address of the database to be connected
$ Db_server = "localhost ";
// Database username
$ Db_user_name = "change to your database username ";
// Database password
$ Db_user_password = "change the password of your database here ";
// Database name
$ Db_name = "change to your database name ";
// 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! Check the user name and password!
";
Exit (0 );
}
$ Flag = mysql_select_db ($ db_name, $ conn );
If (! $ Flag)
{
Echo"
The database is connected normally, but the specified database cannot be opened!
";
Exit (0 );
}
// Execute the query
$ Result = mysql_query ($ SQL, $ conn );
While ($ row = mysql_fetch_array ($ result ))
{
?>
,
}
Mysql_close ($ conn); // Close the database connection
?>
For 2, this is quite troublesome ...... Because any email service provider that contains such a large amount of data will block you, the best way is to build your own SMTP server or use the group sending tool, this is done by Google :)
This article describes how to implement PHP batch query of the WordPress message body's e-mail address. This article provides the implementation code, which is required...