Ejemplo n.º 1
0
 void PostProcessCommand(MyEmailEventArgs e)
 {
     if (OnPostBack != null)
     {
         OnPostBack(this, e);
     }
 }
Ejemplo n.º 2
0
        public void ProcessValidEmail(Chilkat.Email email)
        {
            //Raise event
            var emailEventArgs = new MyEmailEventArgs();

            emailEventArgs.From    = EmailUtility.CleanEmailAddress(email.From);
            emailEventArgs.Subject = email.Subject;
            emailEventArgs.Uidl    = email.Uidl;
            emailEventArgs.Content = email.Body;
            OnFoundEmail(emailEventArgs);



            //int numAttached;
            //bool success;

            //numAttached = email.NumAttachments;
            //if (numAttached > 0)
            //{
            //    success = email.SaveAllAttachments(email.Uidl + "myAttachments");
            //    if (success != true)
            //    {
            //        Console.WriteLine(email.LastErrorText);
            //    }
            //}
        }
Ejemplo n.º 3
0
 public virtual void OnFoundEmail(MyEmailEventArgs e)
 {
     if (FoundEmail != null)
     {
         FoundEmail(this, e);
     }
 }
Ejemplo n.º 4
0
 public bool CanProcess(MyEmailEventArgs e)
 {
     if (e.From.ToUpper().Contains("ACOM.COM"))
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 5
0
        public void Process(MyEmailEventArgs e)
        {
            //using (StreamWriter writetext = new StreamWriter("emailContent.txt"))
            //{
            //    writetext.WriteLine(e.Content);
            //}
            CreateContact(ParseEmailContent(e.Content));

            PostProcessCommand(e);
            Console.WriteLine("-------------------------------");
        }
Ejemplo n.º 6
0
 private void Rearder_FoundEmail(object sender, MyEmailEventArgs e)
 {
     if (controllers.All(s => !s.CanProcess(e)))
     {
         nonCommandControlder.Process(e);
     }
     else
     {
         controllers.Where(s => s.CanProcess(e))
         .ToList()
         .ForEach(d => d.Process(e));
     }
 }
Ejemplo n.º 7
0
        public void Process(MyEmailEventArgs e)
        {
            Console.WriteLine("Forwarding message {0}!!!", e.Subject);
            Chilkat.Email mail = mailMan.FetchEmail(e.Uidl);
            if (mail == null)
            {
                Console.WriteLine("Cannot get the remail {0}", e.Uidl);
                return;
            }
            Chilkat.Email forwardMail = mail.CreateForward();
            forwardMail.From = "*****@*****.**";
            forwardMail.AddTo("Thao Vo", "*****@*****.**");
            bool success = mailMan.SendEmail(forwardMail);

            if (success == false)
            {
                Console.WriteLine(mailMan.LastErrorText);
            }

            PostProcessCommand(e);
        }
Ejemplo n.º 8
0
 public void Process(MyEmailEventArgs e)
 {
     //throw new NotImplementedException();
     Console.WriteLine("Skip- Non command");
 }
Ejemplo n.º 9
0
 public bool CanProcess(MyEmailEventArgs e)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 10
0
 public bool CanProcess(MyEmailEventArgs e)
 {
     //Implement logic of command
     return(e.Subject.Contains("Updated Card"));
 }
Ejemplo n.º 11
0
 private void OnPostBack(object sender, MyEmailEventArgs e)
 {
     Console.WriteLine(e.Subject);
 }