Changes Wisag Pitch
This commit is contained in:
@@ -13,7 +13,7 @@ Public Class Email
|
||||
End Sub
|
||||
Public Function NewEmail(mailto As String, mailSubject As String, mailBody As String,
|
||||
mailfrom As String, mailsmtp As String, mailport As Integer, mailUser As String, mailPW As String,
|
||||
AUTH_TYPE As String, Optional attment As String = "")
|
||||
AUTH_TYPE As String, SENDER_INSTANCE As String, Optional attment As String = "")
|
||||
Try
|
||||
_logger.Debug($"in NewEmail..")
|
||||
Dim oEmpfaenger As String()
|
||||
@@ -35,8 +35,12 @@ Public Class Email
|
||||
_logger.Debug($"Message created..")
|
||||
Dim oTextBodyPart As New BodyPart()
|
||||
oTextBodyPart.ContentType = New ContentType("text", "html", "utf-8")
|
||||
|
||||
oTextBodyPart.ContentTransferEncoding = ContentTransferEncoding.QuotedPrintable
|
||||
oTextBodyPart.Body = mailBody
|
||||
Dim formattedBody = "<font face=""Tahoma"">" & mailBody & "<br><br>>> Service: " & SENDER_INSTANCE & "<br>" &
|
||||
">> DateTime: " & My.Computer.Clock.LocalTime.ToShortDateString & " " &
|
||||
My.Computer.Clock.LocalTime.ToLongTimeString & "</font>"
|
||||
oTextBodyPart.Body = formattedBody
|
||||
oMessage.BodyParts.Add(oTextBodyPart)
|
||||
If attment <> String.Empty Then
|
||||
If System.IO.File.Exists(attment) Then
|
||||
@@ -68,11 +72,11 @@ Public Class Email
|
||||
oError = True
|
||||
' Continue For
|
||||
End Try
|
||||
_logger.Info("Connected to Client!")
|
||||
_logger.Debug("Connected to Client!")
|
||||
If AUTH_TYPE = "SSL" Then
|
||||
oEmailCient.EnableSsl = True
|
||||
'client.ValidateRemoteCertificate = True
|
||||
_logger.Info("Authentification via SSL.")
|
||||
_logger.Debug("Authentification via SSL.")
|
||||
ElseIf AUTH_TYPE = "TLS" Then
|
||||
' client.ValidateRemoteCertificate = False
|
||||
oEmailCient.StartTls()
|
||||
@@ -83,7 +87,6 @@ Public Class Email
|
||||
_logger.Info("Authentification NONE. SSL disabled")
|
||||
End If
|
||||
Try
|
||||
|
||||
oEmailCient.Connect()
|
||||
Catch ex As Exception
|
||||
_logger.Warn("clsEmail.Client.Connect: " & ex.Message)
|
||||
@@ -97,7 +100,7 @@ Public Class Email
|
||||
oEmailCient.Login(mailUser, mailPW)
|
||||
End If
|
||||
|
||||
_logger.Info("Logged in!")
|
||||
_logger.Debug("Logged in!")
|
||||
Catch ex As Exception
|
||||
Try
|
||||
If mailsmtp.Contains("office365.com") Then
|
||||
|
||||
Reference in New Issue
Block a user