用头像群发邮件!远程php!post发送
21326
- bd1262011-07-31高级会员1684
本教程是借用其他服务器群发邮件!所以不存在被封!
以下是使用联合早报的地址发送的!- 正在发送第{$count_num}封{$qq}邮件。。。。。";
- - 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'] = "$qq@qq.com";
- $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);
- - ?>复制代码