Author |
|
jvinis Newbie
Joined: 20 May 2008
Online Status: Offline Posts: 18
|
Posted: 21 May 2008 at 7:39am | IP Logged
|
|
|
How can i retrieve uids from deleted messages for the last 5 days from gmail account?
thanks
|
Back to Top |
|
|
Andrew AfterLogic Support
Joined: 28 April 2006 Location: United States
Online Status: Offline Posts: 1189
|
Posted: 22 May 2008 at 1:36am | IP Logged
|
|
|
You should select Trash folder via Imap.SelectFolder method, then search for UIDs via Imap.Search method with SINCE search clause (current date minus 5 days).
Best regards,
Andrew
|
Back to Top |
|
|
chintan Newbie
Joined: 19 May 2009 Location: India
Online Status: Offline Posts: 7
|
Posted: 28 July 2009 at 4:26am | IP Logged
|
|
|
Above Method seems to be not working as of now.(July-2009)
I have tried imp.SelectFolder("Trash") and imp.SelectFolder("Spam") both method but it returns following message
"The server has responded with negative reply. The server responded: MBN00000003 NO Unknown Mailbox: Trash (Failure)."
Any idea why its not working ?
also DELETED flag doesn't work
uids = CType(imp.Search(True, "DELETED", Nothing), UidCollection)
Please reply ASAP.
|
Back to Top |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 28 July 2009 at 5:05am | IP Logged
|
|
|
Quote:
Above Method seems to be not working as of now.(July-2009) |
|
|
Are you trying to use this method on GMail account?
We have used the following code:
Code:
using MailBee;
using MailBee.ImapMail;
using MailBee.Security;
...
Imap.LicenseKey = "trial or permanent license key";
Imap imp = new Imap();
imp.SslMode = SslStartupMode.OnConnect;
imp.Connect("imap.gmail.com", 993);
imp.Login("username", "password");
FolderCollection folders = imp.DownloadFolders();
foreach (Folder imapFolder in folders)
{
Console.WriteLine(imapFolder.Name);
}
imp.SelectFolder("Trash");
Console.WriteLine("TRASH: " + imp.MessageCount);
imp.SelectFolder(@"[Gmail]/Spam");
Console.WriteLine("SPAM: " + imp.MessageCount);
imp.Disconnect();
Console.ReadLine(); |
|
|
The code lists all the IMAP folders available on the account and then displays number of messages in Trash and Spam folders. As you can see, there is no folder called "Spam", you should refer to it using "[Gmail]/Spam" folder name. With regard to Trash, either "Trash" or "[Gmail]/Trash" folder name can be used.
If you're using mail server other than GMail, you should make sure those folder exists.
With regard to Deleted flags, it doesn't mean messages placed to Trash. Instead, it means messages marked as deleted. Check this documentation page for details on this.
--
Regards,
Igor, AfterLogic Support
|
Back to Top |
|
|