PHP batch query WordPress message recipient's E-mail address implementation method, wordpress message holder _ PHP Tutorial

Source: Internet
Author: User
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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.