public EmailService(EmailServiceParams serviceParams, IResourceResolver resourceResolver) { if (serviceParams.FromAddress.Clear() == null) { throw new Exception("From address cannot be null or empty"); } if (serviceParams.SmtpAddress.Clear() == null || serviceParams.SmtpPort == 0) { throw new Exception("Invalid SMTP server configuration"); } ServiceParams = serviceParams; From = ExtensionsLocal.GetMailAddress(serviceParams.FromAddress, serviceParams.FromDisplayName); Sender = ExtensionsLocal.GetMailAddress(serviceParams.SenderAddress, serviceParams.SenderDisplayName) ?? From; UseAuthentication = false; ResourceResolver = resourceResolver; }