Hunny Software Library Reference

SmtpClient.AuthCramMd5 Method 

Sends the AUTH CRAM-MD5 command.

[Visual Basic]
Public Sub AuthCramMd5( _
   ByVal name As String, _
   ByVal password As String _
)
[C#]
public void AuthCramMd5(
   string name,
   string password
);

Parameters

name
The user name for the authentication.
password
The password for the authentication.

Remarks

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.

Exceptions

Exception TypeCondition
ExceptionIf a network or protocol error occurs.

See Also

SmtpClient Class | Hunny.Mail Namespace | SmtpClient.AuthPlain method | SMTP Service Extension for Authentication | Simple Authentication and Security Layer (SASL)