Plz find below code which i have used :
ImapClient client = new ImapClient(“imap.gmail.com”, 993, “”, “”); //Use your credentials of Gmail
// Set security mode
client.SecurityOptions = SecurityOptions.Auto;
try
{
// Get the message info collection
ImapMessageInfoCollection list = client.ListMessages();
// Download each message
//for (int i = 0; i < list.Count; i++)
//{
// // Save the EML file locally
// client.SaveMessage(list[i].UniqueId, dataDir + list[i].UniqueId + ".eml");
//}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
XCoder