全球主机交流论坛

标题: 用头像群发邮件!远程php!post发送 [打印本页]

作者: bd126    时间: 2011-7-31 00:58
标题: 用头像群发邮件!远程php!post发送
本教程是借用其他服务器群发邮件!所以不存在被封!

以下是使用联合早报的地址发送的!
  1. <?php
  2. header("Content-type:image/png");
  3. //header("Content-Type: image/jpeg");
  4. //readfile('logo.jpg');

  5. $count_num=0;
  6. //如果存放计数器文件已经存在,读取其中的内容
  7. if(file_exists("counter.txt")){
  8. $fp=fopen("counter.txt","r");
  9. $count_num=0+fgets($fp,9);
  10. $count_num++;  
  11. fclose($fp);
  12. }

  13. $fp=fopen("counter.txt","w");

  14. fputs($fp,$count_num);

  15. fclose($fp);

  16. $fromname= file_get_contents("fromname.txt");//邮件标题
  17. $eml= file_get_contents("eml.txt");//邮件内容
  18. $content = file_get_contents("qq.txt");//邮件地址
  19. $content = str_replace( "\r", "", $content );
  20. $content = preg_split( "/\\n/", $content, -1, PREG_SPLIT_NO_EMPTY );
  21. $qq= $content[$count_num];
  22. //echo "<h2 align=center>正在发送第{$count_num}封{$qq}邮件。。。。。</h2>";

  23. function fcontents($url,$post_data)
  24. {
  25. $ch = curl_init();
  26. curl_setopt($ch, CURLOPT_POST, 1);
  27. curl_setopt($ch, CURLOPT_HEADER, 0);
  28. curl_setopt($ch, CURLOPT_URL,$url);
  29. //为了支持cookie
  30. curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
  31. curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
  32. curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  33. curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT,10);
  34. $fcontents = curl_exec($ch);
  35. return $fcontents;
  36.    }


  37. $post_data = array();
  38. $post_data['toMail'] = "$qq";
  39. $post_data['fromName'] = "{$fromname}#@qq.com";
  40. //$post_data['fromMail'] = "[email protected]";
  41. $post_data['content'] = "$eml";
  42. $post_data['submit'] = "submit";

  43. $o="";
  44. foreach ($post_data as $k=>$v)
  45. {
  46.    $o.= "$k=".urlencode($v)."&";

  47. }
  48. $post_data=substr($o,0,-1);
  49. $body=fcontents('http://www.zaobao.com//asianet/recommend/send_news03.pl',$post_data);

  50. function baby($url){
  51.         $ch = curl_init();
  52. curl_setopt ($ch, CURLOPT_URL, $url);
  53. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  54. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
  55. curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  56. curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT,10);
  57. $baby = curl_exec($ch);
  58.         //$fcontents =iconv("UTF-8", "gb2312//IGNORE",curl_exec($ch));
  59.   return $baby;
  60. }


  61. $url = 'https://my.frantech.ca/cart.php?a=add&pid=67';//监控buyvm
  62. $con = baby($url);
  63. $BuyVM = "BuyVM";
  64. $ok = "有货";
  65. $no = "无货";
  66. $lost= count($content)-$count_num;

  67. $email="邮件还剩{$lost}封";
  68. $email2="正在发送{$qq}";
  69. //$font = "/usr/share/fonts/chinese/TrueType/uming.ttf"; //字体设置部分linux和windows的路径可能不同
  70. $font = "/usr/share/fonts/chinese/TrueType/SimHei.ttf"; //字体设置部分linux和windows的路径可能不同
  71. $im = imagecreate(120,120);
  72. $white = imagecolorallocate($im,128,64,225);
  73. $black = imagecolorallocate($im,255,255,255);



  74. if (preg_match("/Out of Stock/i", $con)) {
  75.   imagettftext($im,15,0,10,20,$black,$font,$BuyVM);
  76.   imagettftext($im,15,0,70,20,$black,$font,$no);
  77.    imagettftext($im,10,0,2,40,$black,$font,$email);
  78.    imagettftext($im,8,0,1,60,$black,$font,$email2);
  79. } else {
  80.    imagettftext($im,15,0,10,20,$black,$font,$BuyVM);
  81.    imagettftext($im,15,0,70,20,$black,$font,$ok);
  82.    imagettftext($im,10,0,2,40,$black,$font,$email);

  83. }

  84. imagepng($im);

  85. ?>
复制代码

作者: 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