PHP batch query WordPress message recipient's E-mail address implementation method, wordpress message recipient. PHP batch query WordPress message recipient's E-mail address implementation method. wordpress message recipients receive E-mail text messages from many Bloger friends today. hey, it's fun, but how does they implement PHP batch query of the WordPress message recipient's e-mail address?
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
<? Php
// 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 ))
{
?>
<? Echo $ row ["comment_author_email"]?>,
<? Php
}
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 :)
Parse received E-mail text messages from many Bloger friends today. Hey, it's fun, but how are they...