AngularAzureSearch.WebAPI.Services.MailService.SendMail C# (CSharp) Method

SendMail() public method

public SendMail ( string from, string to, string subject, string body, bool isHtml ) : bool
from string
to string
subject string
body string
isHtml bool
return bool
        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;
        }
MailService