我希望将联系表发送到 1 个以上的地址。目前的代码是
$to = 'email@email.com';
再往下的代码是
function xmail($to,$subject,$message,$headers){
global $usesmtp,$smtphost,$smtpport,$smtpuser,$smtppass,$smtpsecure,$_POST;
if($usesmtp!=1){
if(@mail($to,$subject,$message,$headers)){
return 1;
}
}else{
require_once('mail/class.phpmailer.php');
$mail = new PHPMailer();
$body =$message;
$mail->IsSMTP();
$mail->SMTPDebug = 0;
$mail->SMTPAuth = true;
$mail->SMTPSecure = $smtpsecure;
$mail->Host = $smtphost;
$mail->Port = $smtpport;
$mail->Username = $smtpuser;
$mail->Password = $smtppass;
$mail->SetFrom($_POST['email'], $_POST['name']);
$mail->Subject = $subject;
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
$mail->MsgHTML($body);
$address = $to;
$mail->AddAddress($address, "Administrator");
if($mail->Send()) {
return 1;
}
}
}
有人可以帮忙吗?