全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 3108|回复: 33
打印 上一主题 下一主题

用头像群发邮件!远程php!post发送

[复制链接]
跳转到指定楼层
1#
发表于 2011-7-31 00:58:56 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本教程是借用其他服务器群发邮件!所以不存在被封!

以下是使用联合早报的地址发送的!
  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. ?>
复制代码

评分

参与人数 3威望 +45 收起 理由
hitsword + 5 广告/SPAM
cnx + 20 精品文章
WAKAKA + 20 我很赞同

查看全部评分

2#
发表于 2011-7-31 01:01:28 | 只看该作者
强大啊
3#
发表于 2011-7-31 01:05:43 | 只看该作者
原帖由 lemss 于 2011-7-31 01:01 发表
强大啊
4#
发表于 2011-7-31 01:06:08 | 只看该作者
标记下
5#
发表于 2011-7-31 01:11:58 | 只看该作者
加分mark
6#
发表于 2011-7-31 01:17:00 | 只看该作者
这个厉害了。
7#
发表于 2011-7-31 01:26:31 | 只看该作者
发邮件的服务很多,我见过几个IT网站也能发。
8#
发表于 2011-7-31 01:34:45 | 只看该作者
mark
9#
发表于 2011-7-31 01:42:09 | 只看该作者
牛逼 不错~
10#
发表于 2011-7-31 02:11:36 | 只看该作者
太强大了。。还没看明白
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2025-10-30 07:23 , Processed in 0.067320 second(s), 14 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表