public static async Task SendMailAsync(EmailModel model) { using (var mail = BuildMail(model)) using (var smtp = BuildSmtp(model)) await smtp.SendMailAsync(mail); }
public static void SendMail(EmailModel model) { using (var mail = BuildMail(model)) using (var smtp = BuildSmtp(model)) smtp.Send(mail); }