Phpmailer-phpemailer failed to send

Source: Internet
Author: User
Tags ssl connection
{Code ...}
10:24:57 CLIENT-> SERVER: EHLO www. a. com2016-06-29 10:24:57 CLIENT-> SERVER: AUTH LOGIN2016-06-29 10:24:57 CLIENT-> SERVER: MzA1MzU2MTIzQHFxLmNvbQ = 10:24:57 CLIENT-> SERVER: YWRtaW44ODg = 10:24:57 smtp error: Password command failed: 535 Error: ������������������������: http://service.mail.qq.com/cgi-bin/help? Subtype = 1 & id = 28 & no = 10012562016-06-29 10:24:57 SMTP Error: cocould not authenticate.2016-06-29 10:24:57 CLIENT-> SERVER: QUIT2016-06-29 10:24:57 SMTP connect () failed. https://github.com/phpmailer/phpmailer/wiki/troubleshootingfailed to send the mail, error message: SMTP connect () failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
  SMTPDebug = 1; // use smtp Authentication to send emails, of course, you can select the pop mode sendmail mode. This article will not elaborate. // you can refer to http://phpmailer.github.io/phpmailer/for details in this section. /smtp?authentication must be true $ mail-> SMTPAuth = true; // link the server address of the qq domain name email address $ mail-> Host = 'smtp .qq.com '; // Set logon authentication using ssl encryption $ mail-> SMTPSecure = 'SSL '; // Set the remote server Port number for ssl connection to the smtp server. optional values: 465 or 587 $ mail-> Port = 465; // Set the smtp helo message header, which can have no content, any $ mail-> IsSMTP (); $ mail-> Username = "30535690@qq.com "; // username $ mail-> Password = "admin888 "; // password // whether the email body is html encoded. Note that a method is no longer a property of true or false $ mail-> isHTML (true ); // Set the recipient's email address. this method has two parameters. The first parameter is the recipient's email address. The second parameter is the nickname set for this address. different email addresses are automatically processed and changed. here, the second parameter is used. not significant $ mail-> addAddress ('1970 @ qq.com ', 'jingjing online user'); // add multiple recipients to call the method multiple times. $ mail-> addAddress ('lijuan @ baidu.com ', 'jingjing online user '); // add the Subject of the email $ mail-> Subject = 'example of an email sent by PHPMailer '; // Set isHTML to true at the top of the email body, it can be a complete html string. for example, use the file_get_contents function to read the local html file $ mail-> Body = "this isPHPMailerA test case for sending an email "; // add an attachment to this email. this method also has two parameters. The first parameter is the directory where the attachment is stored (either relative directory or absolute directory) the second parameter is the name of the attachment in the email attachment // $ mail-> addAttachment ('. /d.jpg','mm.jpg '); // you can call this method multiple times to upload multiple attachments. // $ mail-> addAttachment ('. /Jlib-1.1.0.js ', 'jlib. js '); // boolean value returned by the sending command // PS: After testing, if the recipient does not exist, if no error is returned, true is returned. that is, you need some methods to check whether the email address is valid before sending the email. $ status = $ mail-> send (); // simple judgment and prompt message if ($ status) {echo 'email sent successfully';} else {echo 'email failed, error message not :'. $ mail-> ErrorInfo ;}

Reply content:
10:24:57 CLIENT-> SERVER: EHLO www. a. com2016-06-29 10:24:57 CLIENT-> SERVER: AUTH LOGIN2016-06-29 10:24:57 CLIENT-> SERVER: MzA1MzU2MTIzQHFxLmNvbQ = 10:24:57 CLIENT-> SERVER: YWRtaW44ODg = 10:24:57 smtp error: Password command failed: 535 Error: ������������������������: http://service.mail.qq.com/cgi-bin/help? Subtype = 1 & id = 28 & no = 10012562016-06-29 10:24:57 SMTP Error: cocould not authenticate.2016-06-29 10:24:57 CLIENT-> SERVER: QUIT2016-06-29 10:24:57 SMTP connect () failed. https://github.com/phpmailer/phpmailer/wiki/troubleshootingfailed to send the mail, error message: SMTP connect () failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
  SMTPDebug = 1; // use smtp Authentication to send emails, of course, you can select the pop mode sendmail mode. This article will not elaborate. // you can refer to http://phpmailer.github.io/phpmailer/for details in this section. /smtp?authentication must be true $ mail-> SMTPAuth = true; // link the server address of the qq domain name email address $ mail-> Host = 'smtp .qq.com '; // Set logon authentication using ssl encryption $ mail-> SMTPSecure = 'SSL '; // Set the remote server Port number for ssl connection to the smtp server. optional values: 465 or 587 $ mail-> Port = 465; // Set the smtp helo message header, which can have no content, any $ mail-> IsSMTP (); $ mail-> Username = "30535690@qq.com "; // username $ mail-> Password = "admin888 "; // password // whether the email body is html encoded. Note that a method is no longer a property of true or false $ mail-> isHTML (true ); // Set the recipient's email address. this method has two parameters. The first parameter is the recipient's email address. The second parameter is the nickname set for this address. different email addresses are automatically processed and changed. here, the second parameter is used. not significant $ mail-> addAddress ('1970 @ qq.com ', 'jingjing online user'); // add multiple recipients to call the method multiple times. $ mail-> addAddress ('lijuan @ baidu.com ', 'jingjing online user '); // add the Subject of the email $ mail-> Subject = 'example of an email sent by PHPMailer '; // Set isHTML to true at the top of the email body, it can be a complete html string. for example, use the file_get_contents function to read the local html file $ mail-> Body = "this isPHPMailerA test case for sending an email "; // add an attachment to this email. this method also has two parameters. The first parameter is the directory where the attachment is stored (either relative directory or absolute directory) the second parameter is the name of the attachment in the email attachment // $ mail-> addAttachment ('. /d.jpg','mm.jpg '); // you can call this method multiple times to upload multiple attachments. // $ mail-> addAttachment ('. /Jlib-1.1.0.js ', 'jlib. js '); // boolean value returned by the sending command // PS: After testing, if the recipient does not exist, if no error is returned, true is returned. that is, you need some methods to check whether the email address is valid before sending the email. $ status = $ mail-> send (); // simple judgment and prompt message if ($ status) {echo 'email sent successfully';} else {echo 'email failed, error message not :'. $ mail-> ErrorInfo ;}

The error message is obvious.Password command failedThe password is incorrect.Could not authenticateUnable to pass verification! What else do you not understand!

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.