static class QuickMail { public static void SendMail(string from, string to, string subject, string messageText, bool isHtml) { SmtpClient mymail = new SmtpClient(ConfigurationManager.AppSettings["localsmtp"]); MailMessage message = new MailMessage(from, to, subject, messageText); message.IsBodyHtml = isHtml; mymail.Send(message); } }