예제 #1
0
 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;
 }
예제 #2
0
 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;
 }