Sends the AUTH CRAM-MD5 command.
AUTH is actually the name of the SMTP command; CRAM-MD5 is the name of a registered SASL authentication mechanism, which is supplied as a parameter to the AUTH command. (SASL, described in RFC 2222, means "Simple Authentication and Security Layer".) The CRAM-MD5 authentication mechanism is described in RFC 2195.
CRAM-MD5 is more secure than the PLAIN authentication mechanism. If the server does not support CRAM-MD5, but does support PLAIN, you can use the AuthPlain method to send the AUTH PLAIN command.
The AuthCramMd5 method takes a user name and password
as parameters.
After the method returns, you should check the server's reply code, available as the ReplyCode property. A 235 reply code indicates success.
| Exception Type | Condition |
|---|---|
| Exception | If a network or protocol error occurs. |
SmtpClient Class | Hunny.Mail Namespace | SmtpClient.AuthPlain method | SMTP Service Extension for Authentication | Simple Authentication and Security Layer (SASL)