国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > PHP > 正文

php郵箱發(fā)送類代碼

2024-05-04 21:57:15
字體:
供稿:網(wǎng)友

下面是一款婚戀網(wǎng)站的郵箱發(fā)送實(shí)例代碼,有需要的朋友可以下載

  1. <?php 
  2. //if ($err) {echo "發(fā)送郵件失敗,原因:<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. ?> 

 

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 黄龙县| 正宁县| 专栏| 吉木乃县| 丘北县| 腾冲县| 同仁县| 中方县| 周至县| 抚顺县| 大方县| 齐齐哈尔市| 磴口县| 枣阳市| 女性| 荆门市| 广饶县| 山阳县| 邯郸县| 疏勒县| 金平| 房山区| 拉萨市| 宜良县| 寿光市| 汶上县| 阳高县| 铜川市| 齐齐哈尔市| 延庆县| 林口县| 宜川县| 成安县| 开鲁县| 平湖市| 固镇县| 巴林右旗| 绩溪县| 阿勒泰市| 平果县| 灌云县|