Zwischenstand Okt 2020 (6.0.9)

This commit is contained in:
Daniel Schick 2020-10-08 07:00:20 +00:00
parent c35ed3707e
commit eb49b4ec86
4 changed files with 27 additions and 24 deletions

Binary file not shown.

View File

@ -2,6 +2,6 @@
[assembly: AssemblyCompany("schick Informatik")] [assembly: AssemblyCompany("schick Informatik")]
[assembly: AssemblyProduct("BSMD NSW interface")] [assembly: AssemblyProduct("BSMD NSW interface")]
[assembly: AssemblyInformationalVersion("6.0.8")] [assembly: AssemblyInformationalVersion("6.0.9")]
[assembly: AssemblyCopyright("Copyright © 2014-2020 schick Informatik")] [assembly: AssemblyCopyright("Copyright © 2014-2020 schick Informatik")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]

View File

@ -1,4 +1,4 @@
using System.Reflection; using System.Reflection;
[assembly: AssemblyVersion("6.0.8.*")] [assembly: AssemblyVersion("6.0.9.*")]

View File

@ -145,30 +145,33 @@ namespace bsmd.email
public static void SendSystemInfo(string subject, string body, string recipient) public static void SendSystemInfo(string subject, string body, string recipient)
{ {
using (BSMDMail mailer = new BSMDMail()) using BSMDMail mailer = new BSMDMail();
if(recipient.Equals(Properties.Settings.Default.POP3User, StringComparison.OrdinalIgnoreCase))
{ {
MailMessage message = new MailMessage(); log.Warn("system info recipient is pop3 user, skipping send to avoid loops");
MailAddress fromAddress = new MailAddress(Properties.Settings.Default.Sender); return;
message.From = fromAddress; }
message.Subject = subject; MailMessage message = new MailMessage();
message.IsBodyHtml = false; MailAddress fromAddress = new MailAddress(Properties.Settings.Default.Sender);
message.Body = body; message.From = fromAddress;
message.Subject = subject;
message.IsBodyHtml = false;
message.Body = body;
message.To.Add(recipient); message.To.Add(recipient);
MailAddress adminAddress = new MailAddress(Properties.Settings.Default.AdminEmail); MailAddress adminAddress = new MailAddress(Properties.Settings.Default.AdminEmail);
message.CC.Add(adminAddress); message.CC.Add(adminAddress);
try try
{ {
mailer.Send(message); mailer.Send(message);
} }
catch (SmtpException smtpException) catch (SmtpException smtpException)
{ {
log.ErrorFormat("SMTP error while sending e-mail:{0}", smtpException.Message); log.ErrorFormat("SMTP error while sending e-mail:{0}", smtpException.Message);
} }
catch (Exception ex) catch (Exception ex)
{ {
log.ErrorFormat("other error while sending e-mail:{0}", ex.Message); log.ErrorFormat("other error while sending e-mail:{0}", ex.Message);
}
} }
} }