예제 #1
0
        public void SendMail(string from, string to, string code, string logoFilePath)
        {
            _emailDto = new EmailDto {
                FromAddress = from, ToAddress = to
            };

            var smtpFac = _clientFactory.CreateFactory(ClientTypes.SMTP, _exceptionService) as SmtpServiceClient;

            _exceptionService.Throw(() => Validator.CheckNull(smtpFac));

            smtpFac.Username   = _appSettings.SmtpUserName;
            smtpFac.Password   = _appSettings.SmtpPassword;
            smtpFac.SmtpDomain = _appSettings.SmtpProvider;
            smtpFac.SmtpPort   = _appSettings.SmtpPort;
            smtpFac.SendRequest(_emailDto, code, logoFilePath); // <- Potential place to implement resilient connections.
        }