コード例 #1
0
        /// <summary>
        /// TEst Serialize Object.
        /// </summary>
        public static void TestSerialize(string filePath)
        {
            var config = new EmailAdaptorConfigurations {
                Domain     = "example.com",
                EnableSsl  = true,
                UserName   = "******",
                Password   = "******",
                SmtpServer = "smtp.example.com",
                Port       = 25
            };

            config.fileName = filePath;
            config.Serialize();
        }
コード例 #2
0
        /// <summary>
        /// Create new instance of EmailAdaptor
        /// </summary>
        /// <param name="config"></param>
        public EmailAdaptor(EmailAdaptorConfigurations config)
            : this()
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            this.config = config;
            base.Host   = config.SmtpServer;
            base.Port   = config.Port;

            //this.smtpClient = new SmtpClient(config.SmtpServer , config.Port);
            var netCredential = new NetworkCredential();

            netCredential.Domain   = config.Domain;
            netCredential.UserName = config.UserName;
            netCredential.Password = config.Password;

            base.Credentials = netCredential;
            base.EnableSsl   = config.EnableSsl;
        }