Messaging: First working version of OAuth2

This commit is contained in:
Jonathan Jenne
2023-09-06 10:24:46 +02:00
parent 6f33261101
commit e8974376c5
4 changed files with 59 additions and 17 deletions

View File

@@ -30,11 +30,16 @@ Namespace Mail
End Sub
Public Function Connect(pServer As String, pPort As Integer, pUser As String, pPassword As String, pAuthType As String) As MailSession.SessionInfo
Return MailSession.ConnectToServer(pServer, pPort, pUser, pPassword, pAuthType, New MailSession.MailSessionOptions)
Return MailSession.ConnectToServerWithBasicAuth(pServer, pPort, pUser, pPassword, pAuthType, New MailSession.MailSessionOptions)
End Function
Public Function ConnectToO365(pUser As String, pClientId As String, pTenantId As String, pClientSecret As String)
Dim oOptions = New MailSession.MailSessionOptions With {.EnableTls1_2 = True}
Return MailSession.ConnectToServerWithO365OAuth(pUser, pClientId, pTenantId, pClientSecret, oOptions)
End Function
Public Function Connect(pServer As String, pPort As Integer, pUser As String, pPassword As String, pAuthType As String, pOptions As MailSession.MailSessionOptions) As MailSession.SessionInfo
Return MailSession.ConnectToServer(pServer, pPort, pUser, pPassword, pAuthType, pOptions)
Return MailSession.ConnectToServerWithBasicAuth(pServer, pPort, pUser, pPassword, pAuthType, pOptions)
End Function
Public Function Disconnect() As Boolean