sandip patel

sandip patel

  • 1.7k
  • 22
  • 820

Move email to folder

Jan 8 2018 12:00 AM
I want to move email inbox to another folder, all that email which subject contain only numeric string. i used IMAP but Exression.Subject cant accept the regex and i am unable to move email according to below condition.
 
List uidss = imap.GetAll(); // uidss gets the all email in inbox
 
List uidss = imap.Search(Expression.Subject(@"^[0-9]")); // search this condition on all email
 
foreach (long uid in uidss) 
{
    
   long mvid = (long)imap.MoveByUID(uid, "new"); // move email by email id to new name folder
   MvEml.Add(mvid);
}