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(); }
private static void ValidateMailSendAttribute(MailSendAttribute attribute, Type parameterType) { attribute.Validate(); }