1

I'm using the ActiveUp.Net.Mail to connect gmail and get mails from Inbox . I want to get mails after a specific date , hour and minute . I tryed for a specific date and it worked succesfully but when I added a time on my query it was stopped This is my code

private MessageCollection GetMailsSinceDate(string mailBox , DateTime dt)
        {
            Mailbox mails = Client.SelectMailbox(mailBox);
            MessageCollection messages = mails.SearchParse("SENTSINCE 02-Dec-2014");
            return messages;
        }

This code works ,but if I use :

MessageCollection messages = mails.SearchParse("SENTSINCE 02-Dec-2014 13:07:29");

This exception appears : Command "search SENTSINCE 02-Dec-2014 13:07:29" failed : 141202032754582 BAD Could not parse command

Can anyone help me please ! Thanks

Scott Solmer
  • 3,871
  • 6
  • 44
  • 72

1 Answers1

0

can you try something like the following So passing with the Parameter you would do the following

 MessageCollection messages = 
      mails.SearchParse("SENTSINCE " 
      + DateTime.Now.ToString(dt.ToString("dd-MMM-yyyy hh:mm:ss"));
MethodMan
  • 18,625
  • 6
  • 34
  • 52