Ejemplo n.º 1
0
        private void OnRoutedMessageHandler(RoutedMessageEventSource source,
                                            QueuedMessageEventArgs e)
        {
            Logger.Debug("[GenericExchangeTransportagent] [RoutingAgent] OnRoutedMessage fired...");
            var emailItem = new EmailItem(e.MailItem);

            _config.RoutingAgentConfig.OnRoutedMessage.ToList().ForEach(
                x => { try { x.Execute(emailItem); } catch (Exception ex) { Logger.Error(ex, @"Error Executing ""OnRoutedMessage"""); } });

            if (emailItem.ShouldBeDeletedFromQueue)
            {
                source.Delete();
            }
        }
Ejemplo n.º 2
0
        private void OnRoutedMessageHandler(RoutedMessageEventSource source, QueuedMessageEventArgs e)
        {
            Logger.Debug("[GenericTransportAgent] RoutingAgent - OnRoutedMessage fired...");
            var emailItem = new EmailItem(e.MailItem);

            foreach (var x in Configuration.Config.RoutingAgentConfig.OnRoutedMessage)
            {
                try
                {
                    x.Execute(emailItem);
                }
                catch (Exception ex)
                {
                    Logger.Error(ex, @"Error Executing ""OnRoutedMessage""");
                }
            }

            if (emailItem.ShouldBeDeletedFromQueue)
            {
                source.Delete();
            }
        }
        private void OnRoutedMessageHandler(RoutedMessageEventSource source,
                                            QueuedMessageEventArgs e)
        {
            Logger.Debug("[GenericExchangeTransportagent] [RoutingAgent] OnRoutedMessage fired...");
            var emailItem = new EmailItem(e.MailItem);
            _config.RoutingAgentConfig.OnRoutedMessage.ToList().ForEach(
                x => { try { x.Execute(emailItem); } catch (Exception ex) { Logger.Error(ex, @"Error Executing ""OnRoutedMessage"""); } });

            if (emailItem.ShouldBeDeletedFromQueue)
            {
                source.Delete();
            }
        }