diff --git a/Messaging/Mail/MailSession.vb b/Messaging/Mail/MailSession.vb index 61c30bfc..e0ad7362 100644 --- a/Messaging/Mail/MailSession.vb +++ b/Messaging/Mail/MailSession.vb @@ -166,7 +166,7 @@ Namespace Mail ElseIf pSession.AuthType = AUTH_SSL Then Try - If pSession.Port = 465 Then + If pSession.Port = 993 Then Logger.Debug("Connecting with [ConnectSSL] on [{0}/{1}]", pSession.Server, pSession.Port) Client.ConnectSSL(pSession.Server, pSession.Port) Else @@ -186,8 +186,13 @@ Namespace Mail ElseIf Session.AuthType = AUTH_SSLTLS Or Session.AuthType = AUTH_STARTTLS Then Try - Logger.Debug("Connecting with [Connect] on [{0}/{1}]", pSession.Server, pSession.Port) - Client.Connect(pSession.Server, pSession.Port) + If pSession.Port = 993 Then + Logger.Debug("Connecting with [ConnectSSL] on [{0}/{1}]", pSession.Server, pSession.Port) + Client.ConnectSSL(pSession.Server, pSession.Port) + Else + Logger.Debug("Connecting with [Connect] on [{0}/{1}]", pSession.Server, pSession.Port) + Client.Connect(pSession.Server, pSession.Port) + End If Logger.Info("Connection Successful!") Dim oSupportsSTARTTLS As Boolean = SupportsSTARTTLS(Client)