Exemplo n.º 1
0
        public IMailSender GetMailSender(eMailClientType clientType)
        {
            if (!MailClients.ContainsKey(clientType))
            {
                MailClients.Add(clientType, GenerateClient(clientType));
            }

            return(MailClients[clientType]);
        }
Exemplo n.º 2
0
        private string GetMailSection(eMailClientType clientType)
        {
            switch (clientType)
            {
            case eMailClientType.Exchange:
                return(Constants.ExchangeMailSection);

            case eMailClientType.Smtp:
            default:
                return(Constants.SmtpMailSection);
            }
        }
Exemplo n.º 3
0
        private IMailSender GenerateClient(eMailClientType clientType)
        {
            switch (clientType)
            {
            case eMailClientType.Smtp:
            default:
                return(SmptClient.Instance);

            case eMailClientType.Exchange:
                return(ExchangeClient.Instance);
            }
        }
Exemplo n.º 4
0
        public MailSettings GetMailSettings(eMailClientType clientType)
        {
            if (MailSettingsCache.ContainsKey(clientType))
            {
                return(MailSettingsCache[clientType]);
            }

            MailSettings clientMailSettings = GenerateMailSettingsFromJsonFile(GetMailSection(clientType));

            MailSettingsCache.Add(clientType, clientMailSettings);

            return(MailSettingsCache[clientType]);
        }