コード例 #1
0
        public static async void SendEmail(this EmailModel email)
        {
            try
            {
                var mail = email.GetMailMessage();

                var server = GetMailServer(email);

                await server.SendMailAsync(mail);

                WindowsEventLog.WriteInfoLog($"Notify emails successfully sent to {string.Join(" - ", mail.To)}");
            }
            catch (Exception exp)
            {
                WindowsEventLog.WriteErrorLog($"Exception in Sending Email: {exp.Message}");
            }
        }