private MailBuilder(IRazorEngineService _razorTemplateService) { _templateService = _razorTemplateService; _mail = new TypeLessMail(); _mail.Settings.SMTPAuthentication = false; _mail.Settings.SMTPEnableSSL = false; _mail.Settings.SMTPort = 25; _mail.Settings.SMTPSSLPort = 587; _mail.Settings.SMTPServer = "localhost"; _mail.Settings.TemplateDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "EmailTemplates"); _mail.Settings.SubjectEncoding = Encoding.UTF8; _mail.Settings.BodyEncoding = Encoding.UTF8; _mail.Settings.CharSet = "UTF-8"; _mail.Settings.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network; }
public IPartialMailI Reset(bool keepSettings = true) { if (keepSettings) { var settings = _mail.Settings; _mail = new TypeLessMail() { Settings = settings }; return(this); } else { _mail = new TypeLessMail(); return(this); } }