ESMTP adopts an authentication mechanism in order to prevent the spread of spam. But in the actual use process, I sometimes found that the verification password I entered is correct, but the system prompt is wrong. What is the reason?
The authentication mechanism of ESMTP is analyzed below:
(Connect to SMTP.elong.com: 25) 220 SP1 ESMTP V2.1EHLO Abcdefg 250-SMTP.ELONG.COM250-PIPELING250-SIZE 20480000250-ETRN250-Auth login plain Digest-MD5 CRAM-MD5 (Supported authentication mechanism type: login , PLAIN, etc.) 250 8BITMIMEAUTH LOGIN334 VXNlcm5hbWU6 (after Base64 decoding: username:) bGlwaW5n (before Base64 encoding: username Alcatell) 334 UGFzc3dvcmQ6 (after Base64 decoding: password:) QWxjYXRlbGw password (before Base64 encoded: 123456) 235 Authentication successful
When execution is executed, the username is: Alcatell, the password is: 123456, but according to the above steps, it always displays the password error, what is the reason? Later, I use Outlook Express to track mail to send logs, discover that the original password verification must be added to an important format symbol.
QWXJYXRLBGW (password before Base64 code: 123456)
Is this sentence, must be changed to: qwxjyxrlbgw =, that is, must add an equal sign, otherwise the password verification is not passed, even if your password is: 123456, then you must add one equal sign on the Base64 encoding of 123456 Otherwise, the system thinks your password is wrong.
The code verified by password is as follows:
// Verify user name sauth = "bglwaw5n / r / n"; // user: alcatell m_wssmtpserver.send ((lpctstr) sauth, sauth.getlength ()); if (! Get_response (username_success, false) {afxMessageBox (" Username failure "); m_wssmtpserver.close (); return false;} // verify password // Password: 123456 sauth =" qwxjyxrlbgw = / r / n "; m_wssmtpserver.send ((lpctstr) sauth, sauth.getlength ()) ; If (! Get_RESPONSE (FALSE)) {AFXMESSAGEBOX ("Login Failure"); m_wssmtpserver.close (); Return False;
}