Which of the following experts can help you with smtp mail? 503 Error: needEHLOandAUTHfirst

Source: Internet
Author: User
Tags smtp auth
For smtp mail, who can help me see 503 Error: needEHLOandAUTHfirstResolvingSMTPserverdomain & quot; smtp.qq.com & quot;... Connectingtohost who can help me see 503 Error: need EHLO and AUTH first
Resolving SMTP server domain "smtp.qq.com "...
Connecting to host address "119.147.74.45" port 25...
Connected to SMTP server "smtp.qq.com ".
S 220 esmtp4.qq.com Esmtp QQ Mail Server
C ehlo localhost
S 250-esmtp4.qq.com
S 250-PIPELINING
S 250-SIZE 52428800
S 250-AUTH LOGIN
S 250-AUTH = LOGIN
S 250 8 BITMIME
C mail from: <839325966@qq.com>
C rcpt to: 276190536@qq.com>
C DATA
S 503 Error: need EHLO and AUTH first!
Disconnected.
Cound not send the message to 276190536@qq.com. Error: 503 Error: need EHLO and AUTH first!

------ Solution --------------------
You need to log in before sending an email
Have you sent the login information to the smtp.qq.com server?
------ Solution --------------------
1) Check whether the POP/SMTP function of your QQ mailbox is enabled?
2) it is possible that your program has been logged on multiple times and is rejected by the QQ mailbox as a malicious login. try another email.
3) paste your code, otherwise others do not know how to help you check
------ Solution --------------------
It is very likely that your QQ mailbox settings are incorrect .. check that pop3 and smtp services have been activated.
------ Solution --------------------
Need EHLO and AUTH first!

Isn't that clear?
You must shake hands first and request to log in.

PHP code
If (! $ Fp = fsockopen ($ this-> smtp ['host'], $ this-> smtp ['port'], $ errno, $ errstr )) {$ this-> message [] = "an error occurred while connecting to the email server. check whether \ r \ n1, server address, and port are set correctly! \ R \ n2, whether the network is smooth! "; Return false;} if (strncmp (fgets ($ fp, 512), '123', 3 )! = 0) {$ this-> message [] = "an error occurred while connecting to the email server. check whether \ r \ n1, server address, and port are set correctly! \ R \ n2, whether the network is smooth! "; Return false;} if ($ this-> smtp ['auth ']) {fwrite ($ fp," EHLO ". $ this-> smtp ['posthost']. "\ r \ n"); while ($ rt = strtolower (fgets ($ fp, 512) {if (strpos ($ rt ,"-")! = 3 | empty ($ rt) {break;} elseif (strpos ($ rt, "2 ")! = 0) {$ this-> message = "an error occurred while handshaking with the server"; return false ;}} fwrite ($ fp, "auth login \ r \ n "); if (strncmp (fgets ($ fp, 512), '20140901', 3 )! = 0) {$ this-> message = "an error occurred while prompting the server to log on for verification"; return false;} fwrite ($ fp, base64_encode ($ this-> smtp ['user']). "\ r \ n"); if (strncmp (fgets ($ fp, 512), '123', 3 )! = 0) {$ this-> message = "smtp auth login authentication username error! "; Return false;} fwrite ($ fp, base64_encode ($ this-> smtp ['pass']). "\ r \ n"); if (strncmp (fgets ($ fp, 512), '123', 3 )! = 0) {$ this-> message = "smtp auth login verification password error! "; Return false ;}} else {fwrite ($ fp," HELO ". $ this-> smtp ['posthost']. "\ r \ n") ;}$ from = $ this-> smtp ['from']; $ from = preg_replace ("/. * \ <(. + ?) \>. */"," \ 1 ", $ from); fwrite ($ fp," mail from: <$ from> \ r \ n "); if (strncmp (fgets ($ fp, 512), '20140901', 3 )! = 0) {$ this-> message = "the sender address is incorrect! "; Return false;} fwrite ($ fp," rcpt to: <$ toemail> \ r \ n "); if (strncmp (fgets ($ fp, 512 ), '123', 3 )! = 0) {$ this-> message = "the recipient's address is incorrect! "; Return false;} fwrite ($ fp," DATA \ r \ n "); if (strncmp (fgets ($ fp, 512), '123', 3 )! = 0) {$ this-> message = "failed to send email data! "; Return false;} $ msg =" Date :". date ("r "). "\ r \ n"; $ msg. = "Subject: $ send_subject \ r \ n"; $ msg. = "$ additional \ r \ n"; $ msg. = "$ send_message \ r \ n. \ r \ n "; fwrite ($ fp, $ msg); $ lastmessage = fgets ($ fp, 512); if (substr ($ lastmessage, 0, 3 )! = 250) {$ this-> message = "an error occurred while connecting to the email server. check whether \ r \ n1, server address, and port are set correctly! \ R \ n2, whether the network is smooth! "; Return false;} fwrite ($ fp," QUIT \ r \ n "); fclose ($ fp); return true;

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.