<?php
require_once(dirname(__FILE__)."/../include/common.inc.php");
function  MyReplace($mystr){    
  if($mystr   ==   null   ||   $mystr   ==   ""   )    
  {    
  return(" ");    
  }    
  else    
  {    
  $mystr   =   str_replace("\n\r","
",$mystr);    
  $mystr   =   str_replace("\r","
",$mystr);    
  $mystr   =   str_replace("\t","    ",$mystr);    
  return $mystr;    
  }    
  } 
if($dopost == "fasong"){
//	echo 1;
//	include 'fyoujian_ln.php';
	
	include("class.phpmailer.php");
	include("class.smtp.php"); // 可选
	$nameArr = explode(",", $_POST['name']);
	error_reporting(E_STRICT);
    date_default_timezone_set("Asia/Shanghai");//设定时区东八区
	
	
	foreach($nameArr as $v){
		$mail             = new PHPMailer();
		$body             = eregi_replace("[\]",'',MyReplace($_POST['neirong']));
		$mail->IsSMTP();
		$mail->SMTPAuth   = true;                  // 必填,SMTP服务器是否需要验证,true为需要,false为不需要
		$mail->Host       = "smtp.163.com";      //必填,设置SMTP服务器
		$mail->Port       = 25;                   // 设置端口
		$mail->Username   = $fsyx;  // 必填,开通SMTP服务的邮箱;任意一个163邮箱均可
		$mail->Password   = $fsmm;            //必填, 以上邮箱对应的密码
		$mail->From       = $fsyx;    //必填,发件人Email
		$mail->FromName   = $qingli;              //必填,发件人昵称或姓名
		$mail->Subject    = $_POST['title'];       //必填,邮件标题(主题)
		$mail->AltBody    = ""; //可选,纯文本形势下用户看到的内容
		$mail->WordWrap   = 50; // 自动换行的字数
		$mail->MsgHTML($body);
		$mail->AddReplyTo($hfyx,$hfqingli);//回复邮箱地址
		$mail->AddAddress($v,$v);//收件人地址。参数一:收信人的邮箱地址,可添加多个。参数二:收件人称呼
		$mail->IsHTML(true); // 是否以HTML形式发送,如果不是,请删除此行
		if(!$mail->Send()) {
		  echo "NO: " . $mail->ErrorInfo;
		} else {
		  echo "OK";
		}
		
		
		
//		fyj_ln($v,$v,$_POST['title'],MyReplace($_POST['neirong']),$fsyx,$fsmm,$qingli,$hfyx,$hfqingli);
//		fyj_ln($name,$yname,$title,$body,$fsyx,$fsmm,$qingli,$hfyx,$hfqingli)
	}
}else{
	include_once(dirname(__FILE__)."/templets/lina.html");
}


声明:此文系舞林cuznwww.wulinlw.org)原创稿件,转载请保留版权

附件下载:
发邮件代码.zip 20.56KB

et_highlighter