How to connect to Gmail using IMAP?

+1 vote
asked Jan 12, 2010 by Rebex KB (8,190 points)
edited Apr 5, 2011

How do I connect to Gmail using IMAP protocol? I want to retrieve email messages.

Applies to: Rebex Secure Mail

1 Answer

+1 vote
answered Jan 12, 2010 by Rebex KB (8,190 points)
edited Apr 5, 2011
 
Best answer

Gmail runs TLS/SSL secured IMAP server on imap.gmail.com, port 993. Following C# code demonstrates how to connect to it using Rebex Secure Mail or Rebex Secure IMAP:

// connect and log in
Imap imap = new Imap();
imap.Connect("imap.gmail.com", 993, null, ImapSecurity.Implicit);
imap.Login(username, password);

// process messagess...

// logount and disconnect
imap.Disconnect();
commented Jan 14, 2010 by Lukas Pokorny (104,290 points)
edited Apr 5, 2011

For more information about TLS/SSL and its modes (explicit/implicit), check out our tutorial at http://www.rebex.net/secure-mail.net/tutorial-ssl.aspx

...