+1 vote
by (8.6k points)
edited

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

Applies to: Rebex Secure Mail

1 Answer

+1 vote
by (8.6k points)
edited
 
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();
by (148k points)
edited

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

...