VerifyServerCert Property


If True, SSL object will verify server certificate each time SSL-enabled object (such as SMTP, POP3 or IMAP4) connects to the mail server.

By default is False, i.e. SSL object will accept any server certificate regardless whether it is trusted or not.

The server certificate is considered "trusted" if it was issued by trusted authority (from Windows's point of view). In Windows, list of trusted authorities can be viewed or managed using "Control panel/Internet options/Content/Certificates/Trusted Root Certification Authorities".

However, you can select your own trusted certificates list instead of system default one using SelectServerCertStore method.


Value Type: Boolean
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
Mailer.EnableLogging = True
Mailer.LogFilePath = "C:\Temp\smtp_log.txt"
Mailer.ClearLog
Mailer.LicenseKey = "put your license key here"

' Set SSL connection over STARTTLS command
Mailer.SSL.Enabled = True
Mailer.SSL.UseStartTLS = True

' Only trusted server cerificates will be accepted
Mailer.SSL.VerifyServerCert = True

Mailer.ServerName = "mail.server.com"
Mailer.Message.ToAddr = "bill@yoursite.com"
Mailer.Message.FromAddr = "joe@mysite.com"
Mailer.Message.Subject = "Hello"
Mailer.Message.BodyText = "Body"
If Mailer.Connect Then
  Mailer.Send
  Mailer.Disconnect
Else
  MsgBox Mailer.ErrDesc
End If

See Also:

SelectServerCertStore Method


Copyright © 2002-2024, AfterLogic Corporation. All rights reserved.