MS Messaging Logging

This commit is contained in:
Developer01
2025-02-25 11:39:20 +01:00
parent bf8a2971ec
commit bbd97acfc5
3 changed files with 21 additions and 16 deletions

View File

@@ -135,13 +135,18 @@ Namespace Mail
Private Function AddAttachments(pMailBuilder As Limilabs.Mail.MailBuilder, pAttachments As List(Of String)) As Limilabs.Mail.MailBuilder
For Each oAttachment In pAttachments
Try
' Read attachment from disk, add it to Attachments collection
If IO.File.Exists(oAttachment) Then
Logger.Debug("Adding attachment [{0}] to mail.", oAttachment)
pMailBuilder.AddAttachment(oAttachment)
If oAttachment <> String.Empty Then
' Read attachment from disk, add it to Attachments collection
If IO.File.Exists(oAttachment) Then
Logger.Debug("Adding attachment [{0}] to mail.", oAttachment)
pMailBuilder.AddAttachment(oAttachment)
Else
Logger.Warn("Attachment [{0}] does not exist. Skipping.", oAttachment)
End If
Else
Logger.Warn("Attachment [{0}] does not exist. Skipping.", oAttachment)
Logger.Debug("Attachment is String.Empty")
End If
Catch ex As Exception
Logger.Warn("Could not read or add attachment [{0}]!", oAttachment)
Logger.Error(ex)