diff --git a/Messaging/Email.vb b/Messaging/Email.vb
index 85e3b606..194b69c6 100644
--- a/Messaging/Email.vb
+++ b/Messaging/Email.vb
@@ -294,9 +294,12 @@ Public Class Email
_logger.Debug("SSL = false")
myClient.EnableSsl = False
End If
- _logger.Debug($"mailUser [{mailUser}]")
- myClient.Credentials = New NetworkCredential(mailUser, mailPW)
- myClient.UseDefaultCredentials = False
+ If mailUser <> String.Empty Then
+ _logger.Debug($"mailUser [{mailUser}]")
+ myClient.Credentials = New NetworkCredential(mailUser, mailPW)
+ myClient.UseDefaultCredentials = False
+ End If
+
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}"
diff --git a/Messaging/Email2.vb b/Messaging/Email2.vb
index 6575d591..40072604 100644
--- a/Messaging/Email2.vb
+++ b/Messaging/Email2.vb
@@ -69,9 +69,10 @@ Public Class Email2
pSMTP.StartTLS()
End If
Logger.Debug("Connection to SMTP Server [{0}] established!", pServer)
-
- Logger.Debug("Logging in with user [{0}]", pUsername)
- pSMTP.UseBestLogin(pUsername, pPassword)
+ If pUsername <> String.Empty Then
+ Logger.Debug("Logging in with user [{0}]", pUsername)
+ pSMTP.UseBestLogin(pUsername, pPassword)
+ End If
Return pSMTP
diff --git a/Messaging/MailSender.vb b/Messaging/MailSender.vb
index 3181d127..00b46035 100644
--- a/Messaging/MailSender.vb
+++ b/Messaging/MailSender.vb
@@ -39,7 +39,7 @@ Public Class MailSender
Password = pPassword
AuthType = pAuthType
- Logger.Info("Connecting to Server..")
+ Logger.Debug("Connecting to Server..")
Logger.Debug("SMTP Server: [{0}]", Server)
Logger.Debug("SMTP Port: [{0}]", Port)
Logger.Debug("SMTP User: [{0}]", User)
@@ -108,9 +108,10 @@ Public Class MailSender
End If
Try
- Logger.Info("Logging in with user [{0}]", pUser)
- oSession.UseBestLogin(pUser, pPassword)
-
+ If pUser <> String.Empty Then
+ Logger.Info("Logging in with user [{0}]", pUser)
+ oSession.UseBestLogin(pUser, pPassword)
+ End If
Catch ex As Exception
Logger.Warn("Error while connecting with Auth type PLAINTEXT!")
Logger.Error(ex)