AuthMethod Property


MailBee.IMAP4 object can establish connection with the IMAP4 server using various authentication types.

Default setting is a regular authentication. All IMAP4 servers support it, but it is insecure. During regular authentication user password is sent to server in a plain-text form, so the password can be intercepted by a malicious person.

However, MailBee also supports secure authentication methods. All you need for using a secure connection is to set AuthMethod property value prior to connecting.

Also, MailBee supports Integrated Windows Authentication (IWA) so you can use any of NTLM or GSSAPI methods specifying empty username. In this case, MailBee will automatically obtain the current user credentials from the operating system. This is widely used with Microsoft services like MS Exchange Server or IIS.

AuthMethod property must be set BEFORE calling Connect method, otherwise it will not take effect.

The following authentication method are allowed:

UserDomain property is not used with regular or CRAM-MD5 authentication. TargetName is only used with GSSAPI/Kerberos.

Note: Particular IMAP4 server might not support some authentication types.


Value Type: Long
Parameters: None 

Usage example:

Dim Mailer
'Using visual basic to create object
Set Mailer = CreateObject("MailBee.IMAP4")
'Using ASP to create object
'Set Mailer = Server.CreateObject("MailBee.IMAP4")
'In ASP use Response.Write instead of MsgBox
Mailer.LicenseKey = "put your license key here"
Mailer.ServerName = "mailserver.com"
Mailer.UserName = "MyName"
Mailer.Password = "MyPassword"
Mailer.AuthMethod = 1 ' Using CRAM-MD5 secure authentication
Mailer.Connect
If Mailer.Connected Then
  MsgBox "Connected using CRAM-MD5 secure authentication"
  Mailer.Disconnect
End If

See Also:

Connect Method


Copyright 2002-2011, AfterLogic Corporation. All rights reserved.