PHP Bulk Query WordPress message user e-mail address implementation method, WordPress message _php Tutorial

Source: Internet
Author: User

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"]?&GT;
<?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 ...

  • 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.