phpmailer 展示邮件发送成功 却收不到邮件?哪位大侠知道原因

WBOY
Release: 2016-06-13 12:58:08
Original
952 people have browsed it

phpmailer 显示邮件发送成功 却收不到邮件?哪位大侠知道原因
类是我网上下载的!然后自己填了下 显示已经发送成功 可是邮箱却收不到邮件!

require("class.phpmailer.php"); 
$mail = new PHPMailer(); //建立邮件发送类
$address = $_POST['address'];
$mail->IsSMTP(); // 使用SMTP方式发送
$mail->CharSet = "UTF-8";                     //chinese;
$mail->Host = "smtp.qq.com"; // 局smtp服务器
$mail->SMTPAuth = true; // 启用SMTP验证功能
$mail->Username = "1017113114"; // 用户名(请填写完整的email地址)
$mail->Password = "******"; // 密码

$mail->From = "1017113114@qq.com"; //邮件发送者email地址
$mail->FromName = "yyyyyy";
$mail->AddAddress("w_6175@qq.com", "tttt");//收件人地址

//$mail->AddAttachment("/var/tmp/file.tar.gz"); // 添加附件
$mail->IsHTML(true); // set email format to HTML //是否使用HTML格式

$mail->Subject = "PHPMailer测试邮件"; //邮件标题
$mail->Body = "Hello,这是测试邮件,百度"; //邮件内容
$mail->AltBody = "from 火星"; //附加信息,可以省略
//$mail->SMTPDebug;

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

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

echo "邮件发送成功";
?>
------解决方案--------------------
这个只有把debug信息输出来看看才知道
------解决方案--------------------
$mail->SMTPDebug=true ;  //打开这行

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template