Phpmailer indicates that the email is successfully sent but cannot be received? Who knows the reason?

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.