private static SmtpClient CreateSmtpClient(MailSendAttribute binding)
        {
            var smtp = new SmtpClient(binding.Host, binding.Port);

            smtp.EnableSsl = binding.UseSsl;

            if (!string.IsNullOrEmpty(binding.User) && !string.IsNullOrEmpty(binding.Password))
            {
                smtp.Credentials = new NetworkCredential(binding.User, binding.Password);
            }

            return(smtp);
        }
 public MailAsyncCollector(MailSendAttribute binding)
 {
     _binding = binding;
     _binding.Validate();
 }
Ejemplo n.º 3
0
 private static void ValidateMailSendAttribute(MailSendAttribute attribute, Type parameterType)
 {
     attribute.Validate();
 }