Phpmailer Show message sent successfully but not received? Which Warrior knows the reason, how to deal with it

Source: Internet
Author: User
Phpmailer Show message sent successfully but not received? Who knows why?
The class is I download online! Then you fill out the display has been sent successfully but the mailbox but not receive mail!

Require ("class.phpmailer.php");
$mail = new Phpmailer (); Set up a mail sending class
$address = $_post[' address '];
$mail->issmtp (); Send using SMTP mode
$mail->charset = "UTF-8"; Chinese;
$mail->host = "smtp.qq.com"; Office SMTP Server
$mail->smtpauth = true; Enable the SMTP authentication feature
$mail->username = "1017113114"; User name (please fill in the full email address)
$mail->password = "******"; Password

$mail->from = "[email protected]"; Email Sender Email Address
$mail->fromname = "yyyyyy";
$mail->addaddress ("[Email protected]", "tttt");//Recipient address

$mail->addattachment ("/var/tmp/file.tar.gz"); Add an attachment
$mail->ishtml (TRUE); Set email format to HTML//whether HTML is used

$mail->subject = "phpmailer test mail"; Message header
$mail->body = "Hello, this is test mail, Baidu"; Message content
$mail->altbody = "From Mars"; Additional information, you can omit
$mail->smtpdebug;

if (! $mail->send ())
{
echo "message failed to send.

";
echo "Error Reason:". $mail->errorinfo;
Exit
}

echo "Mail sent successfully";
?>
------Solution--------------------
This only knows when the debug message is out.
------Solution--------------------
$mail->smtpdebug=true; Open this line.

  • Related Article

    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.