示例#1
0
文件: BaseBl.cs 项目: andreyu/Reports
 protected void SendEmailToBilling(IEmailDtoSupport model,string from,
     string subject, string body)
 {
     try
     {
         SetEmailDtoForBilling(model, from, subject, body);
         SendEmail(model.EmailDto);
     }
     catch (Exception ex)
     {
         Log.Error("Exception:", ex);
         model.EmailDto.Error = "Исключение: " + ex.GetBaseException().Message;
     }
 }
示例#2
0
文件: BaseBl.cs 项目: andreyu/Reports
 protected void SetEmailDtoForBilling(IEmailDtoSupport model, string from,
         string subject, string body)
 {
     EmailDto dto = new EmailDto();
     Settings settings = SettingsDao.LoadFirst();
     if (settings == null)
     {
         dto.Error = "Отсутствуют настройки в базе данных.";
         model.EmailDto = dto;
         return;
     }
     dto.SmtpServer = settings.BillingSmtp;
     dto.SmtpPort = settings.BillingPort;
     dto.UserName = settings.BillingLogin;
     dto.Password = settings.BillingPassword;
     dto.From = from ?? settings.NotificationEmail;
     dto.To = settings.BillingEmail;
     dto.Subject = subject;
     dto.Body = body;
     model.EmailDto = dto;
 }
示例#3
0
文件: BaseBl.cs 项目: andreyu/Reports
 protected void SendEmail(Settings settings, IEmailDtoSupport model,
             string to, string subject, string body)
 {
     try
     {
         SetEmailDto(settings,model, to, subject, body);
         SendEmail(model.EmailDto);
     }
     catch (Exception ex)
     {
         Log.Error("Exception:", ex);
         model.EmailDto.Error = "Исключение: " + ex.GetBaseException().Message;
     }
 }