GlobalAutodetectPortAndSslMode Property
Gets or sets whether MailBee should override SSL mode and/or port to use when it detects well-known mail server hostname (like gmail.com) or port number (like 995).

Namespace: MailBee
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
Syntax
public static bool AutodetectPortAndSslMode { get; set; }

Property Value

Type: Boolean
If true, MailBee will override SSL mode and/or port to use when connecting to the mail server if it detects well-known mail server hostname or port number. If false, MailBee will always use the values specified by the application. The default value is true.
Remarks
This property makes it easier for the programmer to implement the logic of connecting to mail servers which require SSL connections. Currently, when it's true, SslMode of the corresponding Pop3, Smtp or Imap object has the default value Manual and the developer calls Connect or BeginConnect method, the following checks are made:
  • If the hostname is "pop.gmail.com", use OnConnect mode and port 995.
  • If the hostname is "imap.gmail.com", use OnConnect mode and port 993.
  • If the hostname is "smtp.gmail.com", use UseStartTlsIfSupported mode if the application specifies port 25 or 587, or OnConnect if the port specified is 465.
  • If the hostname is "pop3.live.com", use OnConnect mode and port 995.
  • If the hostname is "smtp.live.com", use UseStartTlsIfSupported mode if the application specifies port 25 or 587.
  • If the hostname is "pop-mail.outlook.com" or "pop3-mail.outlook.com", use OnConnect mode and port 995.
  • If the hostname is "imap-mail.outlook.com", use OnConnect mode and port 993.
  • If the hostname is "smtp-mail.outlook.com", use UseStartTlsIfSupported mode and port 587.
  • If the hostname is "imap.mail.yahoo.com", use OnConnect mode and port 993.
  • If the hostname is "pop.mail.yahoo.com", use OnConnect mode and port 995.
  • If the hostname is "smtp.mail.yahoo.com", use OnConnect mode and port 465.
  • If the hostname ends with ".office365.com" or ".outlook.com" (but not "pop-mail.outlook.com", "pop3-mail.outlook.com", "imap-mail.outlook.com", "smtp-mail.outlook.com"), use UseStartTlsIfSupported mode and regular port (applies to SMTP, IMAP, POP3).
  • If the hostname is not well-known, use UseStartTlsIfSupported mode if the application specifies port 587 for SMTP connection, or use OnConnect mode if the port is 465 for SMTP, 995 for POP3 or 993 for IMAP.
If you want to manually specify port and SSL mode, set this property value to false. For example, this can be useful if the mail server you're connecting to runs a regular (not SSL) POP3 service on the dedicated SSL POP3 port 995 and you want to use Manual mode.
Note Note
SSL mode and port overriding will not occur if the application itself changes SslMode from its default value Manual.

Note that in Visual Basic you need to use the fully qualified name when accessing this property. Use MailBee.Global.AutodetectPortAndSslMode, not Global.AutodetectPortAndSslMode. This is because Global is a keyword in VB.

See Also