示例#1
0
        protected CustomMailBase(IMailProviderTemplate provider, string fromAddress, string fromAddressPass,
                                 string fromDisplayName = null, string subject = null, string body = null)
        {
            SMTPClient      = provider.SMTPClient;
            SSLAbilityState = provider.SSLAbilityState;
            SMTPPort        = provider.SMTPPort;

            Credential  = new NetworkCredential(fromAddress, fromAddressPass);
            FromAddress = new MailAddress(fromAddress, fromDisplayName);
            if (!string.IsNullOrEmpty(subject))
            {
                MessageSubject = subject;
            }
            if (!string.IsNullOrEmpty(body))
            {
                MessageBody = body;
            }
        }
示例#2
0
 public CustomMail(IMailProviderTemplate provider, string fromAddress, string fromAddressPass,
                   string fromDisplayName = null, string subject = null, string body = null)
     : base(provider, fromAddress, fromAddressPass, fromDisplayName, subject, body)
 {
 }