protected override void SendUnrecLetter(Mime m, AddressList fromList, EMailSourceHandlerException e)
        {
            try {
                var attachments = m.Attachments.Where(a => !String.IsNullOrEmpty(a.GetFilename())).Aggregate("", (s, a) => s + String.Format("\"{0}\"\r\n", a.GetFilename()));
                var ms          = new MemoryStream(m.ToByteData());
                FailMailSend(m.MainEntity.Subject, fromList.ToAddressListString(),
                             m.MainEntity.To.ToAddressListString(), m.MainEntity.Date, ms, attachments, e.Message);

                DocumentReceiveLog.Log(GetFirmCodeByFromList(fromList), _addressId, null, _currentDocumentType.DocType, String.Format(@"{0}
Тема            : {1}
Отправители     : {2}
Получатели      : {3}
Список вложений :
{4}
",
                                                                                                                                      e.Message,
                                                                                                                                      m.MainEntity.Subject,
                                                                                                                                      fromList.ToAddressListString(),
                                                                                                                                      m.MainEntity.To.ToAddressListString(),
                                                                                                                                      attachments), IMAPHandler.CurrentUID);
            }
            catch (Exception exMatch) {
                _logger.Error("Не удалось отправить нераспознанное письмо", exMatch);
            }
        }
Esempio n. 2
0
 protected override void SendUnrecLetter(Mime m, AddressList fromList, EMailSourceHandlerException e)
 {
     try {
         var attachments = m.Attachments.Where(a => !String.IsNullOrEmpty(a.GetFilename())).Aggregate("", (s, a) => s + String.Format("\"{0}\"\r\n", a.GetFilename()));
         var ms          = new MemoryStream(m.ToByteData());
         FailMailSend(m.MainEntity.Subject, fromList.ToAddressListString(),
                      m.MainEntity.To.ToAddressListString(), m.MainEntity.Date, ms, attachments, e.Message);
     }
     catch (Exception exMatch) {
         _logger.Error("Не удалось отправить нераспознанное письмо", exMatch);
     }
 }
        protected virtual void SendUnrecLetter(Mime m, AddressList from, EMailSourceHandlerException exception)
        {
            try {
                var attachments = m.Attachments.Where(a => !String.IsNullOrEmpty(a.GetFilename())).Aggregate("", (s, a) => s + String.Format("\"{0}\"\r\n", a.GetFilename()));
                var ms          = new MemoryStream(m.ToByteData());
#if !DEBUG
                SmtpClientEx.QuickSendSmartHost(
                    Settings.Default.SMTPHost,
                    25,
                    Environment.MachineName,
                    Settings.Default.ServiceMail,
                    new[] { Settings.Default.UnrecLetterMail },
                    ms);
#endif
                FailMailSend(m.MainEntity.Subject, from.ToAddressListString(),
                             m.MainEntity.To.ToAddressListString(), m.MainEntity.Date, ms, attachments, exception.Message);
                DownloadLogEntity.Log((ulong)PriceSourceType.EMail, String.Format("Письмо не распознано.Причина : {0}; Тема :{1}; От : {2}",
                                                                                  exception.Message, m.MainEntity.Subject, from.ToAddressListString()));
            }
            catch (Exception exMatch) {
                _logger.Error("Не удалось отправить нераспознанное письмо", exMatch);
            }
        }