void PostProcessCommand(MyEmailEventArgs e) { if (OnPostBack != null) { OnPostBack(this, e); } }
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); // } //} }
public virtual void OnFoundEmail(MyEmailEventArgs e) { if (FoundEmail != null) { FoundEmail(this, e); } }
public bool CanProcess(MyEmailEventArgs e) { if (e.From.ToUpper().Contains("ACOM.COM")) { return(true); } return(false); }
public void Process(MyEmailEventArgs e) { //using (StreamWriter writetext = new StreamWriter("emailContent.txt")) //{ // writetext.WriteLine(e.Content); //} CreateContact(ParseEmailContent(e.Content)); PostProcessCommand(e); Console.WriteLine("-------------------------------"); }
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)); } }
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); }
public void Process(MyEmailEventArgs e) { //throw new NotImplementedException(); Console.WriteLine("Skip- Non command"); }
public bool CanProcess(MyEmailEventArgs e) { throw new NotImplementedException(); }
public bool CanProcess(MyEmailEventArgs e) { //Implement logic of command return(e.Subject.Contains("Updated Card")); }
private void OnPostBack(object sender, MyEmailEventArgs e) { Console.WriteLine(e.Subject); }