Gmail folders

Jul 1, 2012 at 12:08 PM
Edited Jul 1, 2012 at 12:25 PM

Hi,

I'm experimenting with this library and it's very nice.

I just connected to my Gmail account using the ImapClient. This goes well, I can connect to my inbox and retrieve messages, but I cannot seem to connect to the Starred or Sent Mail folders.

This should be client.Select("[Gmail]/Starred"); or for Sent mail client.Select("[Gmail]/Sent Mail");, but it returns as null and no messages can be found.

How can I retrieve messages from my Gmail Starred folder?

This is my code:

 

var client = new ImapClient();
const string host = "imap.gmail.com";
const int port = 993;
			
client.Security = SecurityPolicies.Explicit;
client.Connect(host, port);
client.Authenticate("myMail@gmail.com", "myPassword", SaslMechanics.Login);

var select = client.Select("[Gmail]/Starred");
// select.MailboxInfo.Exists = null

 

Thanks in advance!

Jeff

Jul 1, 2012 at 12:36 PM

I figured it out. It seems that the selected language for Gmail is quite important.

Since my Gmail language is localized to the Dutch language I need to connect to [Gmail]/Met ster.

So client.Select("[Gmail]/Met ster") returns the expected result.

Coordinator
Jul 1, 2012 at 4:44 PM

Sry I couldn't reply earlier, I glad you have found the solution :)