Messaging: Fix Mail Session

This commit is contained in:
Jonathan Jenne 2023-09-14 15:40:23 +02:00
parent e8974376c5
commit a415f90906

View File

@ -166,7 +166,7 @@ Namespace Mail
ElseIf pSession.AuthType = AUTH_SSL Then ElseIf pSession.AuthType = AUTH_SSL Then
Try Try
If pSession.Port = 465 Then If pSession.Port = 993 Then
Logger.Debug("Connecting with [ConnectSSL] on [{0}/{1}]", pSession.Server, pSession.Port) Logger.Debug("Connecting with [ConnectSSL] on [{0}/{1}]", pSession.Server, pSession.Port)
Client.ConnectSSL(pSession.Server, pSession.Port) Client.ConnectSSL(pSession.Server, pSession.Port)
Else Else
@ -186,8 +186,13 @@ Namespace Mail
ElseIf Session.AuthType = AUTH_SSLTLS Or Session.AuthType = AUTH_STARTTLS Then ElseIf Session.AuthType = AUTH_SSLTLS Or Session.AuthType = AUTH_STARTTLS Then
Try Try
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) Logger.Debug("Connecting with [Connect] on [{0}/{1}]", pSession.Server, pSession.Port)
Client.Connect(pSession.Server, pSession.Port) Client.Connect(pSession.Server, pSession.Port)
End If
Logger.Info("Connection Successful!") Logger.Info("Connection Successful!")
Dim oSupportsSTARTTLS As Boolean = SupportsSTARTTLS(Client) Dim oSupportsSTARTTLS As Boolean = SupportsSTARTTLS(Client)