+1 vote
by (8.4k 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.4k 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 (144k 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

...