AutosetPortAndSSL Property


Tells MailBee whether to automatically enable secure connection mode based on the current port and server name settings.

The default value is True.

You may consider setting it to False only if your server expects regular non-SSL connection on a port which is normally SSL. See SSL object topic for the list of well-known SSL ports. In all cases, setting this property to False won't have any effect.

This property, when True, also checks if the server name contains ".gmail.com". If yes, MailBee will automatically connect to SSL ports because Gmail is known to be SSL-only service.

Note: it's still recommended to manually set the port (e.g. PortNumber for POP3) and SSL properties like Enabled and UseStartTls and do not rely on automatic selection of port number and SSL mode because it can work only in limited number of well-known cases.


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 and ignore automatic SSL setting 
Mailer.SSL.Enabled = True
Mailer.SSL.UseStartTLS = True
Mailer.SSL.AutosetPortAndSSL = False

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:

SSL.Enabled Property


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