Hunny Software Library Reference

SmtpClient.AuthPlain Method 

Sends the AUTH PLAIN command.

[Visual Basic]
Public Sub AuthPlain( _
   ByVal name As String, _
   ByVal password As String _
)
[C#]
public void AuthPlain(
   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; PLAIN 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 PLAIN authentication mechanism is described in RFC 2595.

PLAIN is the least secure of all the SASL authentication mechanisms, since the password is essentially sent unencrypted across the network. The CRAM-MD5 authentication mechanism is much more secure. You can use the AuthCramMd5 method to send the AUTH CRAM-MD5 command.

The AuthPlain 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.AuthCramMd5 method | SMTP Service Extension for Authentication | Simple Authentication and Security Layer (SASL)