多多色-多人伦交性欧美在线观看-多人伦精品一区二区三区视频-多色视频-免费黄色视屏网站-免费黄色在线

國內最全IT社區平臺 聯系我們 | 收藏本站
阿里云優惠2
您當前位置:首頁 > php開源 > php教程 > php郵箱發送類代碼

php郵箱發送類代碼

來源:程序員人生   發布時間:2013-11-08 08:33:19 閱讀次數:3766次

下面是一款婚戀網站的郵箱發送實例代碼,有需要的朋友可以下載

  1. <?php 
  2. //if ($err) {echo "發送郵件失敗,原因:<br>";foreach($err as $a){echo $a."<br>";}} 
  3. class wrzc_netmail { 
  4. /*  var $localhost; 
  5.  var $smtp_accname; 
  6.  var $smtp_password; 
  7.  var $smtp_host; 
  8.  var $from; 
  9.  var $fromname; 
  10.  */ function send($to$subject = 'no subject'$body) { 
  11.  $localhost = $this->localhost; 
  12.  $smtp_accname = $this->smtp_accname; 
  13.  $smtp_password = $this->smtp_password; 
  14.  $smtp_host = $this->smtp_host; 
  15.  $from = $this->from; 
  16.  $fromname = $this->fromname; 
  17.  $lb = "rn"
  18.  $headers = "content-type: text/html;charset="gbk""
  19.  $headers.= $lb
  20.  $headers.= "content-transfer-encoding: base64"
  21.  $hdr = explode($lb$headers); 
  22.  if ($body) { 
  23.  $bdy = preg_replace("/^./"".."explode($lb$body));} 
  24.  $smtp[] = array("ehlo ".$localhost.$lb"220,250""ehlo error: "); 
  25.  $smtp[] = array("auth login".$lb"334""auth error: "); 
  26.  $smtp[] = array(base64_encode($smtp_accname).$lb"334""authentification error: "); 
  27.  $smtp[] = array(base64_encode($smtp_password).$lb"235""authentification error: "); 
  28.  $smtp[] = array("mail from: <".$from.">".$lb"250""mail from error: "); 
  29.  $smtp[] = array("rcpt to: <".$to.">".$lb"250""rcpt to error: "); 
  30.  $smtp[] = array("data".$lb"354""data error: "); 
  31.  $smtp[] = array("from: ".$fromname." <".$from.">".$lb""""); 
  32.  $smtp[] = array("subject: ".$subject.$lb""""); 
  33.  $smtp[] = array("to: ".$to.$lb""""); 
  34.  foreach ($hdr as $h) { 
  35.  $smtp[] = array($h.$lb"""");} 
  36.  $smtp[] = array($lb""""); 
  37.  if ($bdy) { 
  38.  foreach ($bdy as $b) { 
  39.  $smtp[] = array(base64_encode($b.$lb).$lb"""");}} 
  40.  $smtp[] = array(".".$lb"250""data(end)error: "); 
  41.  $smtp[] = array("quit".$lb"221""quit error: "); 
  42.  $fp = @fsockopen($smtp_host, 25); 
  43.  if (!$fp
  44.  return "error: cannot conect to '".$smtp_host."' by port 25"
  45.  while ($result = @fgets($fp, 1024)) { 
  46.  if (substr($result, 3, 1) == " ") { 
  47.  break;}} 
  48.  $result_str
  49.  foreach ($smtp as $req) { 
  50.  @fputs($fp$req[0]); 
  51.  if ($req[1]) { 
  52.  while ($result = @fgets($fp, 1024)) { 
  53.  if (substr($result, 3, 1) == " ") { 
  54.  break;}}; 
  55.  if (!strstr($req[1], substr($result, 0, 3))) { 
  56.  $result_str[] = $req[2].$result;}}} 
  57.  @fclose($fp); 
  58.  return $result_str;} 
  59.  function setlocalhost($localhost) {$this->localhost = $localhost;} 
  60.  function setsmtp_accname($smtp_accname) {$this->smtp_accname = $smtp_accname;} 
  61.  function setsmtp_password($smtp_password) {$this->smtp_password = $smtp_password;} 
  62.  function setsmtp_host($smtp_host) {$this->smtp_host = $smtp_host;} 
  63.  function setfrom($from) {$this->from = $from;} 
  64.  function setfromname($fromname) {$this->fromname = $fromname;} 
  65. //unset 
  66. ?> 

 

生活不易,碼農辛苦
如果您覺得本網站對您的學習有所幫助,可以手機掃描二維碼進行捐贈
程序員人生
------分隔線----------------------------
分享到:
------分隔線----------------------------
關閉
程序員人生
主站蜘蛛池模板: 欧美 亚洲 激情 | 日韩中文字幕精品一区在线 | 久久综合中文字幕一区二区三区 | 手机在线看片国产日韩生活片 | 午夜5060| 看看黄色一级片 | 福利片在线观看 | 欧美性猛交xxxx乱大交高清 | 黑人巨大 | 亚洲欧美日韩精品永久在线 | 男女视频免费看 | 99精品国产在这里白浆 | 手机在线亚洲 | 亚洲一区二区免费视频 | 成人免费视频一区 | 国产亚洲精品久久久久久久 | 日韩精品免费一级视频 | 爱操在线视频 | 欧美18videossex性欧美 | 久久精品国产在热久久2019 | 欧美一区二区三区网站 | 成人a视频 | 久久亚洲欧美 | 亚洲区视频在线观看 | 一级毛片不卡片免费观看 | 欧美一级二级毛片视频 | 久久亚洲欧美成人精品 | 国产成人精品高清不卡在线 | 国产高清成人吃奶成免费视频 | 亚洲xxxxxx| 久久性生活视频 | 亚洲一区免费看 | 尤物视频在线观看视频 | 欧美一级www | 亚洲精品国产一区二区三区在 | 国产一区二区三区亚洲综合 | 国产精品一区不卡 | 国产精品精品视频 | 色吊丝一区二区 | 97精品国产综合久久久久久欧美 | 国产国语一级毛片全部 |