全球主机交流论坛
标题:
用头像群发邮件!远程php!post发送
[打印本页]
作者:
bd126
时间:
2011-7-31 00:58
标题:
用头像群发邮件!远程php!post发送
本教程是借用其他服务器群发邮件!所以不存在被封!
以下是使用联合早报的地址发送的!
<?php
header("Content-type:image/png");
//header("Content-Type: image/jpeg");
//readfile('logo.jpg');
$count_num=0;
//如果存放计数器文件已经存在,读取其中的内容
if(file_exists("counter.txt")){
$fp=fopen("counter.txt","r");
$count_num=0+fgets($fp,9);
$count_num++;
fclose($fp);
}
$fp=fopen("counter.txt","w");
fputs($fp,$count_num);
fclose($fp);
$fromname= file_get_contents("fromname.txt");//邮件标题
$eml= file_get_contents("eml.txt");//邮件内容
$content = file_get_contents("qq.txt");//邮件地址
$content = str_replace( "\r", "", $content );
$content = preg_split( "/\\n/", $content, -1, PREG_SPLIT_NO_EMPTY );
$qq= $content[$count_num];
//echo "<h2 align=center>正在发送第{$count_num}封{$qq}邮件。。。。。</h2>";
function fcontents($url,$post_data)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_URL,$url);
//为了支持cookie
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT,10);
$fcontents = curl_exec($ch);
return $fcontents;
}
$post_data = array();
$post_data['toMail'] = "$qq";
$post_data['fromName'] = "{$fromname}#@qq.com";
//$post_data['fromMail'] = "
[email protected]
";
$post_data['content'] = "$eml";
$post_data['submit'] = "submit";
$o="";
foreach ($post_data as $k=>$v)
{
$o.= "$k=".urlencode($v)."&";
}
$post_data=substr($o,0,-1);
$body=fcontents('http://www.zaobao.com//asianet/recommend/send_news03.pl',$post_data);
function baby($url){
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT,10);
$baby = curl_exec($ch);
//$fcontents =iconv("UTF-8", "gb2312//IGNORE",curl_exec($ch));
return $baby;
}
$url = 'https://my.frantech.ca/cart.php?a=add&pid=67';//监控buyvm
$con = baby($url);
$BuyVM = "BuyVM";
$ok = "有货";
$no = "无货";
$lost= count($content)-$count_num;
$email="邮件还剩{$lost}封";
$email2="正在发送{$qq}";
//$font = "/usr/share/fonts/chinese/TrueType/uming.ttf"; //字体设置部分linux和windows的路径可能不同
$font = "/usr/share/fonts/chinese/TrueType/SimHei.ttf"; //字体设置部分linux和windows的路径可能不同
$im = imagecreate(120,120);
$white = imagecolorallocate($im,128,64,225);
$black = imagecolorallocate($im,255,255,255);
if (preg_match("/Out of Stock/i", $con)) {
imagettftext($im,15,0,10,20,$black,$font,$BuyVM);
imagettftext($im,15,0,70,20,$black,$font,$no);
imagettftext($im,10,0,2,40,$black,$font,$email);
imagettftext($im,8,0,1,60,$black,$font,$email2);
} else {
imagettftext($im,15,0,10,20,$black,$font,$BuyVM);
imagettftext($im,15,0,70,20,$black,$font,$ok);
imagettftext($im,10,0,2,40,$black,$font,$email);
}
imagepng($im);
?>
复制代码
作者:
lemss
时间:
2011-7-31 01:01
强大啊
作者:
神马皆浮云
时间:
2011-7-31 01:05
原帖由
lemss
于 2011-7-31 01:01 发表
强大啊
作者:
edmin
时间:
2011-7-31 01:06
标记下
作者:
WAKAKA
时间:
2011-7-31 01:11
加分mark
作者:
funkys
时间:
2011-7-31 01:17
这个厉害了。
作者:
wdlth
时间:
2011-7-31 01:26
发邮件的服务很多,我见过几个IT网站也能发。
作者:
qiqi13245
时间:
2011-7-31 01:34
mark
作者:
wst321
时间:
2011-7-31 01:42
牛逼 不错~
作者:
啊猪同学
时间:
2011-7-31 02:11
太强大了。。还没看明白
作者:
ronon
时间:
2011-7-31 03:29
有意思,触发式
作者:
loveni
时间:
2011-7-31 05:13
Mark
作者:
qiqibian
时间:
2011-7-31 07:39
很多可以发 Yahoo的不错
作者:
wjhhxl
时间:
2011-7-31 07:41
关注下
作者:
mslxd
时间:
2011-7-31 08:08
牛人啊,,,呵呵
作者:
geyunbing
时间:
2011-7-31 08:09
提示:
作者被禁止或删除 内容自动屏蔽
作者:
elves766
时间:
2011-7-31 08:11
标记下
作者:
greyboy
时间:
2011-7-31 08:14
mark
作者:
cnx
时间:
2011-7-31 08:16
标题:
回复 1# bd126 的帖子
早就看到楼主你头像在用了。
作者:
hitsword
时间:
2011-7-31 08:40
加分mark
作者:
microka
时间:
2011-7-31 08:42
原帖由
lemss
于 2011-7-31 01:01 发表
强大啊
作者:
誓誓
时间:
2011-7-31 08:46
高手
作者:
13407
时间:
2011-7-31 10:55
看不明白。
作者:
greensnow
时间:
2011-7-31 11:00
基本上没什么意义
作者:
金关村村长
时间:
2011-7-31 11:36
就看看吧
作者:
95147
时间:
2011-7-31 11:44
强大啊~~~~~~
作者:
wvidc
时间:
2011-7-31 11:59
原理是???
作者:
cgsyzdd
时间:
2011-7-31 12:18
我勒个去、
作者:
Lins
时间:
2011-7-31 12:28
原帖由
誓誓
于 2011-7-31 08:46 发表
高手
作者:
有个就好
时间:
2011-7-31 12:56
用头像?
作者:
cosence
时间:
2011-7-31 13:12
提示:
作者被禁止或删除 内容自动屏蔽
作者:
ptah
时间:
2011-7-31 15:19
Mark
作者:
fackarp
时间:
2011-7-31 15:53
mark............
作者:
ericls
时间:
2011-7-31 16:31
看楼主头像
欢迎光临 全球主机交流论坛 (https://loc.010206.xyz/)
Powered by Discuz! X3.4