Home > php教程 > php手册 > body text

PHP批量查询WordPress留言者E-mail地址实现方法,wordpress留言者

WBOY
Release: 2016-06-13 09:14:27
Original
1120 people have browsed it

PHP批量查询WordPress留言者E-mail地址实现方法,wordpress留言者

今天收到了很多Bloger朋友的E-mail拜年短信,嘿嘿,感觉很好玩,可是他们是如何实现的这个呢,很简单的,可是简单的分为两步:

1)通过SQL查询获取E-mail地址

2)通过某种方法群发E-mail

对于1,几行PHP代码可以解决:

复制代码 代码如下:


xmlns="http://www.w3.org/1999/xhtml">


WordPress 邮件群发工具 Designed By Kaisir


//要连接的数据库地址
$db_server="localhost";
//数据库用户名
$db_user_name="这里改成你的数据库用户名";
//数据库密码
$db_user_password="这里改成你的数据库的密码";
//数据库名
$db_name="这里改成你的数据库名";
//以下代码请不要修改
$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"

数据库连接失败!请检查用户名密码!

";
 exit(0);
}
$flag=mysql_select_db($db_name,$conn);
if(!$flag)
{
 echo"

数据库连接正常,但无法打开指定的数据库!

";
 exit(0);
}
//执行查询
$result=mysql_query($sql,$conn);
while($row=mysql_fetch_array($result))
{
?>
,
}
mysql_close($conn);//关闭数据库连接
?>


对于2,这个就比较麻烦了……因为那么大数据量的邮件任何一个邮件服务商都会把你屏蔽掉的,所以最好的办法就是自己搭建SMTP服务器,或者使用群发工具,嘿嘿,这个就由大家自己Google好了啦 :)

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!