diff --git a/DDZUGFeRDService/App.config b/DDZUGFeRDService/App.config
index 44d74781..a6961b43 100644
--- a/DDZUGFeRDService/App.config
+++ b/DDZUGFeRDService/App.config
@@ -31,6 +31,9 @@
10
+
+ Data Source=172.24.12.41\tests;Initial Catalog=DD_ECM;Persist Security Info=True;User ID=sa;Password=ddd
+
\ No newline at end of file
diff --git a/DDZUGFeRDService/My Project/Settings.Designer.vb b/DDZUGFeRDService/My Project/Settings.Designer.vb
index 37e6b49b..808abbc7 100644
--- a/DDZUGFeRDService/My Project/Settings.Designer.vb
+++ b/DDZUGFeRDService/My Project/Settings.Designer.vb
@@ -116,6 +116,16 @@ Namespace My
Return CType(Me("JOB_INTERVAL"),Integer)
End Get
End Property
+
+ _
+ Public ReadOnly Property MSSQL_CONNECTION() As String
+ Get
+ Return CType(Me("MSSQL_CONNECTION"),String)
+ End Get
+ End Property
End Class
End Namespace
diff --git a/DDZUGFeRDService/My Project/Settings.settings b/DDZUGFeRDService/My Project/Settings.settings
index f340b8c1..3a3afdf8 100644
--- a/DDZUGFeRDService/My Project/Settings.settings
+++ b/DDZUGFeRDService/My Project/Settings.settings
@@ -23,5 +23,8 @@
10
+
+ Data Source=172.24.12.41\tests;Initial Catalog=DD_ECM;Persist Security Info=True;User ID=sa;Password=ddd
+
\ No newline at end of file
diff --git a/GUI_EDMI/frmEmailAccount.vb b/GUI_EDMI/frmEmailAccount.vb
index 9ac55d31..a2e2083f 100644
--- a/GUI_EDMI/frmEmailAccount.vb
+++ b/GUI_EDMI/frmEmailAccount.vb
@@ -164,7 +164,7 @@ Public Class frmEmailAccount
Dim PWPlain = wrapper.DecryptData(txtEMAIL_PW.Text)
- If _Email.NewEmail(txtTestmail.Text, "Testmail DD Windream-ResultHandler", "This is the body (text will be replaced within profile)", txtEMAIL_FROM.Text, txtSERVER_OUT.Text, txtPORT_OUT.Text, txtEMAIL_USER.Text, PWPlain, cmbAUTH_TYPE.Text, "EDMI GUI") = True Then
+ If _Email.NewEmail(txtTestmail.Text, "Testmail", "This is the bodytext", txtEMAIL_FROM.Text, txtSERVER_OUT.Text, txtPORT_OUT.Text, txtEMAIL_USER.Text, PWPlain, cmbAUTH_TYPE.Text, "EDMI GUI") = True Then
MsgBox("Email was send successfully.", MsgBoxStyle.Information)
Else
MsgBox("Could not send the testmail. Please check the log.", MsgBoxStyle.Exclamation)
diff --git a/Message/Email.vb b/Message/Email.vb
index 767a1d6a..9d338965 100644
--- a/Message/Email.vb
+++ b/Message/Email.vb
@@ -6,6 +6,7 @@ Imports Independentsoft.Email.Imap
Imports DigitalData.Modules.Logging
Imports System.Net.Mail
Imports System.Net
+Imports System.Security
Public Class Email
Private _logger As Logging.Logger
@@ -133,7 +134,6 @@ Public Class Email
mailfrom As String, mailsmtp As String, mailport As Integer, mailUser As String, mailPW As String,
AUTH_TYPE As String, SENDER_INSTANCE As String, Optional attachmentString As String = "", Optional Test As Boolean = False)
Try
- Dim oError As Boolean = False
Dim oReceipiants As String()
If mailto.Contains(";") Then
oReceipiants = mailto.Split(";")
@@ -141,42 +141,42 @@ Public Class Email
ReDim Preserve oReceipiants(0)
oReceipiants(0) = mailto
End If
+ _logger.Debug($"mailsmtp [{mailsmtp}]")
+ _logger.Debug($"mailfrom [{mailfrom}]")
+ _logger.Debug($"mailport [{mailport}]")
For Each oMailReceipiant As String In oReceipiants
_logger.Debug($"oMailReceipiant [{oMailReceipiant}]")
- _logger.Debug($"mailsmtp [{mailsmtp}]")
- Dim sClient As Net.Mail.SmtpClient
- Try
- sClient = New Net.Mail.SmtpClient(mailsmtp, mailport)
- Catch ex As Exception
- _logger.Warn($"Could not create SMTP-Client: [{ex.Message}]")
- Return False
- End Try
- sClient.DeliveryMethod = SmtpDeliveryMethod.Network
- Dim mymesssage As New MailMessage
- sClient.Port = mailport
- _logger.Debug($"mailport [{mailport}]")
+ Dim oSmtp_Server As New Mail.SmtpClient
+ Dim oE_mail As New MailMessage()
+ oSmtp_Server.UseDefaultCredentials = False
+ oSmtp_Server.Credentials = New Net.NetworkCredential(mailUser, mailPW)
+ oSmtp_Server.Port = mailport
If AUTH_TYPE = "SSL" Then
_logger.Debug("SSL = true")
- sClient.EnableSsl = True
+ oSmtp_Server.EnableSsl = True
Else
_logger.Debug("SSL = false")
- sClient.EnableSsl = False
+ oSmtp_Server.EnableSsl = False
End If
- _logger.Debug($"mailUser [{mailUser}]")
- sClient.Credentials = New NetworkCredential(mailUser, mailPW)
- sClient.UseDefaultCredentials = False
+ oSmtp_Server.Host = mailsmtp
+
+ oE_mail = New MailMessage()
+ oE_mail.From = New MailAddress(mailfrom)
+ oE_mail.To.Add(oMailReceipiant)
+ oE_mail.Subject = mailSubject
+ oE_mail.IsBodyHtml = False
If Test = True Then
- mymesssage.Body = $"This is the body (text will be replaced within profile)!
mailsmtp: {mailsmtp}
mailport: {mailport}
mailUser: {mailUser}
mailPW: XXXX
AUTH_TYPE: {AUTH_TYPE}"
+ oE_mail.Body = $"This is the body (text will be replaced within profile)!
mailsmtp: {mailsmtp}
mailport: {mailport}
mailUser: {mailUser}
mailPW: XXXX
AUTH_TYPE: {AUTH_TYPE}"
Else
- mymesssage.Body = mailBody
+ oE_mail.Body = mailBody
End If
_logger.Debug($"mailBody [{mailBody}]")
- 'mymesssage.IsBodyHtml = True
- Dim htmlView As AlternateView = AlternateView.CreateAlternateViewFromString(mymesssage.Body)
+ oE_mail.IsBodyHtml = True
+ Dim htmlView As AlternateView = AlternateView.CreateAlternateViewFromString(oE_mail.Body)
htmlView.ContentType = New System.Net.Mime.ContentType("text/html")
- mymesssage.AlternateViews.Add(htmlView)
+ oE_mail.AlternateViews.Add(htmlView)
_logger.Debug($"attachmentString [{attachmentString}]")
If attachmentString <> "" Then
_logger.Info($"Attachment Path is: {attachmentString}")
@@ -189,29 +189,20 @@ Public Class Email
'ElseIf attment.ToLower.EndsWith("docx") Then
' oAttachment.ContentType = New Independentsoft.Email.Mime.ContentType("application", "MS-word")
'End If
- mymesssage.Attachments.Add(oAttachment)
+ oE_mail.Attachments.Add(oAttachment)
Else
_logger.Debug("No Attachment.")
End If
_logger.Debug($"mailfrom [{mailfrom}]")
-
- mymesssage.From = New MailAddress(mailfrom)
- _logger.Debug($"mailSubject [{mailSubject}]")
- mymesssage.Subject = mailSubject
- mymesssage.To.Add(New MailAddress(oMailReceipiant))
- _logger.Debug($"Now Sending mail...")
- sClient.Send(mymesssage)
+ oSmtp_Server.Send(oE_mail)
_logger.Debug($"Mail has been sent!")
_logger.Info("Message to " & oMailReceipiant & " has been send.")
Next
- If oError = False Then
- Return True
- Else
- Return False
- End If
- Catch ex As Exception
- _logger.Error(ex)
+ Return True
+
+ Catch error_t As Exception
+ _logger.Error(error_t)
Return False
End Try
diff --git a/Modules.Windream/Windream2.vb b/Modules.Windream/Windream2.vb
index 46506857..a9e28883 100644
--- a/Modules.Windream/Windream2.vb
+++ b/Modules.Windream/Windream2.vb
@@ -1171,23 +1171,6 @@ Public Class Windream2
End Try
Dim ExportFileIO = New WMOTOOLLib.WMFileIO ' CreateObject("WMOTOOLLib.WMFileIO") ' New WMOTOOLLib.WMFileIO
_logger.Debug("ExportFileIO created...")
- ' Stream Interface bereitstellen
- 'Try
- ' oWMObject.LockFor(WMObjectEditModeMoveReadOnly) 'WMObjectEditModeFileSystem)
- 'Catch ex As Exception
- ' If Not oWMObject.aLocked Then
- ' Try
- ' oWMObject.lock()
- ' Catch ex1 As Exception
- ' _logger.Warn($"{ex1.Message} Could not lock document - DocID: {DocId}")
- ' Return False
- ' End Try
-
- ' End If
- ' '_logger.(ex)
-
- 'End Try
-
Dim oWMStream = oWMObject.OpenStream("BinaryObject", 1)
'### VERSIONIERUNG ###
Dim version As Integer = 2
@@ -1204,10 +1187,9 @@ Public Class Windream2
ExportFileIO.bstrOriginalFileName = tempFilename
'Das eigentliche kopieren
ExportFileIO.ExportOriginal(True)
- ' close the windream file stream
+ 'close the windream file stream
oWMStream.Close()
_logger.Info($"WMFile DocID {DocId} has been exported to {tempFilename} ")
-
Return True
Catch ex As Exception
_logger.Error(ex)