Phpmailer indicates that the email is successfully sent but cannot be received? Which of the following heroes knows the reason? I downloaded it online! Then, enter & nbsp; and check that the email has been successfully sent. & nbsp; But the email cannot be received! & Lt ;? Phprequire ("class. phpmailer. php"); & nbsp; $ mail & nbsp; = & nbs phpmailer indicates that the email is successfully sent but cannot be received? Who knows the reason?
Class is downloaded from the internet! Then, enter the following information to check whether the email has been successfully sent, but the email cannot be received!
Require ("class. phpmailer. php ");
$ Mail = new PHPMailer (); // Create a mail sending class
$ Address = $ _ POST ['address'];
$ Mail-> IsSMTP (); // send using SMTP
$ Mail-> CharSet = "UTF-8"; // chinese;
$ Mail-> Host = "smtp.qq.com"; // Local smtp server
$ Mail-> SMTPAuth = true; // enable SMTP verification
$ Mail-> Username = "1017113114"; // user name (enter the complete email address)
$ Mail-> Password = "******"; // Password
$ Mail-> From = "1017113114@qq.com"; // email address of the sender
$ Mail-> FromName = "yyyyyy ";
$ Mail-> AddAddress ("w_6175@qq.com", "tttt"); // recipient address
// $ Mail-> AddAttachment ("/var/tmp/file.tar.gz"); // add an attachment
$ Mail-> IsHTML (true); // set email format to HTML // whether HTML format is used
$ Mail-> Subject = "PHPMailer test mail"; // mail title
$ Mail-> Body = "Hello, this is the test email, Baidu"; // the email content
$ Mail-> AltBody = "from Mars"; // additional information, which can be omitted
// $ Mail-> SMTPDebug;
If (! $ Mail-> Send ())
{
Echo "failed to send the email.
";
Echo "error cause:". $ mail-> ErrorInfo;
Exit;
}
Echo "email sent successfully ";
?>
------ Solution --------------------
You only need to output the debug information.
------ Solution --------------------
$ Mail-> SMTPDebug = true; // open this line