The Authenticate method is used to authenticate the current
client session to the mail server, ensuring that only valid users may
deliver messages through the server. This method uses the LOGIN
authentication mechanism by default and you can specify an alternate
authentication method by setting the the AuthType
property.
Authentication requires the server to support the AUTH extended
SMTP command and the Extended property must be set to True.
If the server does not support the specified type of authentication,
an error will be returned.
If you with to use OAuth 2.0 for authentication, set the
AuthType property to the desired authentication type
prior to calling this method. The connection must be secure, and the
server must advertise its support for OAuth 2.0 or the authentication
attempt will fail. This method will not attempt to automatically
refresh an expired token.