Ask for advice. Why can't I send emails using SMTP in my local QQ mailbox? I have enabled the SMTP service.
Require_once "email. class. php "; // ********************* configuration information **************** * *************** $ smtpserver = "smtp.qq.com "; // SMTP server $ smtpserverport = 25; // SMTP server port $ smtpusermail = "1322175332@qq.com"; // SMTP server's user email $ smtpemailto = $ _ POST ['topin']; // send to $ smtpuser = "1322175332@qq.com"; // User account of the SMTP server $ smtppass = ""; // SMTP server user password $ mailtitle =$ _ POST ['title']; // email subject $ mailcontent = "". $ _ POST ['content']. ""; // mail content $ mailtype = "HTML"; // mail format (HTML/TXT ), TXT is a text email ******** * ******************* $ smtp = new smtp ($ smtpserver, $ smtpserverport, true, $ smtpuser, $ smtppass); // Here, true indicates that authentication is used; otherwise, authentication is not used. $ smtp-> debug = false; // whether to display the sent debugging information $ state = $ smtp-> sendmail ($ smtpemailto, $ smtpusermail, $ mailtitle, $ mailcontent, $ mailtype); echo""; If ($ state =" ") {echo" Sorry, email sending failed! Check whether the email address is entered incorrectly. "; Echo" Click here to return "; exit ();} echo" Congratulations! Email sent !! "; Echo" Click here to return "; echo"
";
Reply to discussion (solution)
Email password $ smtppass is empty
Email password $ smtppass is empty
I did not write it here. I added it during the test.
The authorization code is used.
The authorization code is used.
Change password to authorization code? Why.
Base64 encoding required