コード例 #1
0
        internal ConfigurationSmtpData Convert(SmtpConfiguration source)
        {
            ConfigurationSmtpData result = new ConfigurationSmtpData();

            if (source != null)
            {
                result.Host     = source.SmtpHost;
                result.Password = null;
                result.Port     = source.SmtpPort;
                result.Username = source.SmtpUsername;
            }
            return(result);
        }
コード例 #2
0
        internal SmtpConfiguration CreateSmtpConfiguration(ConfigurationSmtpData source, SmtpConfiguration original)
        {
            SmtpConfiguration result = new SmtpConfiguration();

            result.SmtpHost = source.Host;
            if (source.Password != null)
            {
                result.SmtpPasswordCipher = Common.Cryptography.EncryptionSupport.Instance.Encrypt(source.Password);
            }
            else
            {
                result.SmtpPasswordCipher = original?.SmtpPasswordCipher;
            }
            result.SmtpPort          = source.Port;
            result.SmtpUsername      = source.Username;
            result.SystemEmailSender = original?.SystemEmailSender;
            return(result);
        }