public bool SendMail(string from, string to, string subject, string body, bool isHtml) { try { var msg = new MailMessage(from, to, subject, body); msg.IsBodyHtml = isHtml; var client = new SmtpClient(); client.Send(msg); } catch (Exception) { return false; } return true; }