/* * System.Net.Mail.MailAddress NewMail = new MailAddress("netwrix.r" + (char)0x26 + "*****@*****.**", "netwrix.r" + (char)0x26 + "d.spb.qc.at.msi", System.Text.Encoding.UTF8); */ public virtual void SendMessage(IMailSettings settings) { var message = new MailMessage( settings.From, settings.To, settings.Subject, settings.Body) { IsBodyHtml = settings.IsBodyHtml }; foreach (var smtpServer in settings.SmtpServers) { var client = new SmtpClient(smtpServer) { UseDefaultCredentials = true }; try { client.Send(message); } catch (Exception ex) { // TODO: AOP Trace.TraceError("SendMessage(IMailSettings settings)"); // ?? Trace.TraceError(ex.Message); } } }
public MailController( IMailService mailService, IMailSettings mailSettings, ILogger <MailController> logger) { _mailService = mailService; _mailSettings = mailSettings; _logger = logger; }
public void Send(MailMessage mailMessage, IMailSettings mailSettings) { try { using (var client = new SmtpClient(mailSettings.SmtpServer, mailSettings.SmtpPort)) { client.UseDefaultCredentials = false; client.Credentials = new NetworkCredential(mailSettings.Username, mailSettings.Password); client.EnableSsl = true; client.Timeout = 10000; client.Send(mailMessage); } } catch (Exception ex) { Logger.Exception(ex); } }
/* System.Net.Mail.MailAddress NewMail = new MailAddress("netwrix.r" + (char)0x26 + "*****@*****.**", "netwrix.r" + (char)0x26 + "d.spb.qc.at.msi", System.Text.Encoding.UTF8); */ public virtual void SendMessage(IMailSettings settings) { var message = new MailMessage( settings.From, settings.To, settings.Subject, settings.Body) { IsBodyHtml = settings.IsBodyHtml }; foreach (var smtpServer in settings.SmtpServers) { var client = new SmtpClient(smtpServer) {UseDefaultCredentials = true}; try { client.Send(message); } catch (Exception ex) { // TODO: AOP Trace.TraceError("SendMessage(IMailSettings settings)"); // ?? Trace.TraceError(ex.Message); } } }
public MailNotifier(IMailSettings mailSettings) { _mailSettings = mailSettings; }
public SendMailService(IMailSettings settings) { this.settings = settings; }
public MailSettingsBO() { mailsettingDAO = new MailSettingsDAO(); }
public MailService(IMailSettings mailSettings) { _mailSettings = mailSettings; }
public SystemNetMailMailer(IMailSettings settings) { this.settings = settings; }
public SendMailService(IMailSettings settings, IRepository<MailTemplate> repository) { this.settings = settings; this.repository = repository; }
public void Send(MailMessage mailMessage, IMailSettings mailSettings) { MailMessage = mailMessage; }
public EmailService(IMailSettings mailConfig) { _mailConfig = mailConfig ?? throw new ArgumentNullException(nameof(mailConfig)); }
public Mail(IMailSender mailSender, IMailSettings mailSettings) { _mailSender = mailSender; _mailSettings = mailSettings; }