用phpmailer发邮件的时候出现有关问题

WBOY
Freigeben: 2016-06-13 12:42:03
Original
1048 Leute haben es durchsucht

用phpmailer发邮件的时候出现问题
require_once('class.phpmailer.php'); //下载的文件必须放在该文件所在目录
$address=$_POST['address'];
echo $address."
";
$mail = new PHPMailer(); //建立邮件发送类
$address = $_POST['address']; 
$mail->IsSMTP(); // 使用SMTP方式发送
$mail->Host = "smtp.163.com"; // 您的企业邮局域名
$mail->SMTPAuth = true; // 启用SMTP验证功能
$mail->Username = "*********@163.com"; // 邮局用户名(请填写完整的email地址)
$mail->Password = "********"; // 邮局密码
$mail->From = "******@163.com"; //邮件发送者email地址
$mail->FromName = "";
$mail->AddAddress("$address", "QQ");//收件人地址,可以替换成任何想要接收邮件的email信箱,
$mail->Subject = "PHPMailer测试邮件"; //邮件标题
$mail->Body = "Hello,这是测试邮件"; //邮件内容
$mail->AltBody = "This is the body in plain text for non-HTML mail clients"; //附加信息,可以省略

if(!$mail->Send())
{
echo "邮件发送失败. 

";
echo "错误原因: " . $mail->ErrorInfo;
exit;
}

echo "邮件发送成功";
?>

Warning: preg_match() [function.preg-match]: Compilation failed: reference to non-existent subpattern at offset 626 in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\class.phpmailer.php on line 667
邮件发送失败. 
错误原因: You must provide at least one recipient email address.


Verwandte Etiketten:
Quelle:php.cn
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!