PHP batch query of the WordPress message recipient's e-mail address _ PHP Tutorial

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

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.