AuthMethod Property


Specifies the method to authenticate the mail sender on the SMTP server.

By default, SMTP authentication is not used but most servers nowadays require it so you'll probably need to enable it.

The following authentication methods are allowed:

If your mail server requires users to authenticate themselves, enable SMTP authentication by setting AuthMethod, UserName, Password property values before calling Connect or Send methods.

Note: Some servers do not require and even do not support any kind of SMTP authentication.


Value Type: Long
Parameters: None 

Usage example:

Dim Mailer

' Using Visual Basic to create object
Set Mailer = CreateObject("MailBee.SMTP")

' Using ASP to create object
' Set Mailer = Server.CreateObject("MailBee.SMTP")
'
' In ASP, use Response.Write instead of MsgBox

' Unlock SMTP component
Mailer.LicenseKey = "put your license key here"

' Specify SMTP server name
Mailer.ServerName = "mail.server.com"

' Use LOGIN authentication method
Mailer.AuthMethod = 2
Mailer.UserName = "johndoe"
Mailer.Password = "secret"

Mailer.Message.ToAddr = "bill@yoursite.com"
Mailer.Message.FromAddr = "joe@mysite.com"
Mailer.Message.Subject = "Hello"
Mailer.Message.BodyText = "The message body"

' Try to send message
If Mailer.Send Then
  MsgBox "Sent successfully"
Else
  ' Notify user about error
  MsgBox "Error #" & Mailer.ErrCode 
End If

' Close the connection
Mailer.Disconnect

See Also:

Connect Method
Domain Property
Password Property
UserName Property


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