Exemplo n.º 1
0
        private void send_notices(IList <SidePOPMailMessage> messages)
        {
            if (messages == null || messages.Count == 0)
            {
                return;
            }

            Log.bound_to(this).log_a_debug_event_containing("{0} is sending notice of {1} messages.", ApplicationParameters.name, messages.Count);
            MessageListEventArgs  messages_event_args = new MessageListEventArgs(messages);
            MessagesReceivedEvent messages_received   = MessagesReceived;

            if (messages_received != null)
            {
                messages_received(this, messages_event_args);
            }

            foreach (SidePOPMailMessage message in messages)
            {
                Log.bound_to(this).log_a_debug_event_containing("{0} is sending notice of message id \"{1}\".", ApplicationParameters.name, message.MessageId);
                MessageEventArgs     message_event_args = new MessageEventArgs(message);
                MessageReceivedEvent message_received   = MessageReceived;
                if (message_received != null)
                {
                    message_received(this, message_event_args);
                }
            }
        }
Exemplo n.º 2
0
 private static void runner_messages_received(object sender, MessageListEventArgs e)
 {
     IEnumerable<SidePOPMailMessage> messages = e.Messages;
     foreach (SidePOPMailMessage message in messages)
     {
         Log.bound_to(typeof(Program)).log_an_info_event_containing("Children.Count: {0}", message.Children.Count);
         Log.bound_to(typeof(Program)).log_an_info_event_containing("message-id: {0}", message.MessageId);
         Log.bound_to(typeof(Program)).log_an_info_event_containing("subject: {0}", message.Subject);
         Log.bound_to(typeof(Program)).log_an_info_event_containing("Attachments.Count: {0}", message.Attachments.Count);
         if (!message.IsBodyHtml)
         {
             Log.bound_to(typeof(Program)).log_an_info_event_containing("Message.Body: {0}", message.Body);
         }
         else
         {
             Log.bound_to(typeof(Program)).log_an_info_event_containing("Message.Body: {0}", message.Body);
         }
     }
 }
Exemplo n.º 3
0
        private static void runner_messages_received(object sender, MessageListEventArgs e)
        {
            IEnumerable <SidePOPMailMessage> messages = e.Messages;

            foreach (SidePOPMailMessage message in messages)
            {
                Log.bound_to(typeof(Program)).log_an_info_event_containing("Children.Count: {0}", message.Children.Count);
                Log.bound_to(typeof(Program)).log_an_info_event_containing("message-id: {0}", message.MessageId);
                Log.bound_to(typeof(Program)).log_an_info_event_containing("subject: {0}", message.Subject);
                Log.bound_to(typeof(Program)).log_an_info_event_containing("Attachments.Count: {0}", message.Attachments.Count);
                if (!message.IsBodyHtml)
                {
                    Log.bound_to(typeof(Program)).log_an_info_event_containing("Message.Body: {0}", message.Body);
                }
                else
                {
                    Log.bound_to(typeof(Program)).log_an_info_event_containing("Message.Body: {0}", message.Body);
                }
            }
        }
Exemplo n.º 4
0
        private void runner_messages_received(object sender, MessageListEventArgs e)
        {
            try
            {
                IEnumerable <SidePOPMailMessage> messages = e.Messages;

                foreach (SidePOPMailMessage message in messages)
                {
                    Email mail_message = Map.from(message).to <Email>();
                    parse_and_send_response(mail_message);
                    save_email_message(mail_message);
                }
            }
            catch (Exception ex)
            {
                Log.bound_to(this).Error("{0} service had an error processing messages on {1} (with user {2}):{3}{4}", ApplicationParameters.name,
                                         Environment.MachineName, Environment.UserName,
                                         Environment.NewLine, ex.ToString());
            }
        }
Exemplo n.º 5
0
        private void send_notices(IList<SidePOPMailMessage> messages)
        {
            if (messages == null || messages.Count == 0) return;

            Log.bound_to(this).log_a_debug_event_containing("{0} is sending notice of {1} messages.", ApplicationParameters.name, messages.Count);
            MessageListEventArgs messages_event_args = new MessageListEventArgs(messages);
            MessagesReceivedEvent messages_received = MessagesReceived;
            if (messages_received != null) messages_received(this, messages_event_args);

            foreach (SidePOPMailMessage message in messages)
            {
                Log.bound_to(this).log_a_debug_event_containing("{0} is sending notice of message id \"{1}\".", ApplicationParameters.name, message.MessageId);
                MessageEventArgs message_event_args = new MessageEventArgs(message);
                MessageReceivedEvent message_received = MessageReceived;
                if (message_received != null) message_received(this, message_event_args);
            }
        }