MS .Net Update

This commit is contained in:
2023-10-11 13:49:10 +02:00
parent 9a33f97c58
commit b9dbd3c4c3
31 changed files with 792 additions and 724 deletions

View File

@@ -1,9 +1,11 @@
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Messaging
Public Class clsJob_Work
Dim Logger As Logger
Private MyLogger As LogConfig
Private _mail As clsEmail
Public Sub New(MyLoggerConf As LogConfig, _email As clsEmail)
Private _mail As MailSender
Public Sub New(MyLoggerConf As LogConfig, _email As MailSender)
Logger = MyLoggerConf.GetLogger()
MyLogger = MyLoggerConf
_mail = _email
@@ -44,11 +46,25 @@ Public Class clsJob_Work
Logger.Warn("PWPlain is Nothing - Could not decrypt passwort 44")
Return False
End If
If _mail.Email_Send(Email_subject, Email_Body, Email_receipiants, oMAILFROM, oMAILSMTP, oMAIL_PORT, oMAIL_USER, oMAIL_USER_PW, oMAIL_AUTH_TYPE, Attachment_Filename) = True Then
Return True
Else
Logger.Warn("Email_Send_Independentsoft was not successfull!")
Return False
Dim oSendto As New List(Of String)
Dim oSplit = Email_receipiants.Split(";")
For Each oMailAdress In oSplit
oSendto.Add(oMailAdress)
Next
Dim oAttMt As New List(Of String)
If Attachment_Filename <> String.Empty Then
oAttMt.Add(Attachment_Filename)
End If
If _mail.ConnectToServer(oMAILSMTP, oMAIL_PORT, oMAIL_USER, oPWPlain, oMAIL_AUTH_TYPE) = True Then
Logger.Info($"MAIL: Connection to {oMAILSMTP} successfull!")
If _mail.SendMail(oSendto, oMAILFROM, Email_subject, Email_Body, Now, oAttMt, 0) = True Then
Return True
Else
Logger.Warn("ConnectToServer was not successfull!")
Return False
End If
End If
Catch ex As Exception
Logger.Error(ex)