public void Error(String Message, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0) { LogMessage(Message, "ERROR", memberName, sourceFilePath, sourceLineNumber); if (new Config().AlertsForErrors) { UpdateCore.Email email = UpdateCore.Email.Instance; // need to use the users configured email address email.SendEmail("Error logged by Updater", Message); } }
// Logger for issues that weren't caused by exceptions being thrown public void Warning(String Message, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0) { LogMessage(Message, "WARNING", memberName, sourceFilePath, sourceLineNumber); if (new Config().AlertsForWarnings) { UpdateCore.Email email = UpdateCore.Email.Instance; // need to use the users configured email address email.SendEmail("Possible Issue logged by Updater", Message); } }
private void button1_Click(object sender, EventArgs e) { try { UpdateCore.Email em = new UpdateCore.Email(); String emai = this.EMAIL.Text; String subj = TypeContact + "| " + this.FULL_NAME.Text + "| " + this.SUBJECT.Text; String bod = this.MESSAGE.Text; em.SendEmail(emai, subj, bod); this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }