public override void ExecuteOption(OptionReport report) { SystemInterface.Email emailSender = new SystemInterface.Email(); emailSender.Send(_databaseEmail.MessageBody, false, _databaseEmail.Subject, Config.Email, _databaseEmail.To, Config.EmailSmtpHost, Config.EmailSmtpPort, Config.Email, Config.EmailPassword); Log.Write(Connection, $"Email sendt to {_databaseEmail.To}", typeof(Email), DataLayer.MongoData.Config.LogLevelEnum.OptionMessage); report.Success = true; }
private bool TrySendSmtpMail(string htmlWithRowsAndFields, string fullname, string fromEmail, string emailaddress1, string subject, string smtpHost, int port, string smtpUsername, string smtpPassword) { SystemInterface.Email emailSender = new SystemInterface.Email(); try { emailSender.Send(htmlWithRowsAndFields, true, subject, fromEmail, emailaddress1, smtpHost, port, smtpUsername, smtpPassword); return(true); } catch (Exception exception) { Log.Write(Connection, exception.Message, typeof(SendTableFromMailrelay), exception.StackTrace, DataLayer.MongoData.Config.LogLevelEnum.OptionError); return(false); } }