I have been trying to use the solution provided in the following link:
using c# .net librarires to check for IMAP messages from gmail servers
But I keep hitting the error:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Is there something that I am missing here. My Code:
public List<MailMessage> ReadMail()
{
List<MailMessage> msgs;
using (var ic = new AE.Net.Mail.ImapClient("imap.gmail.com", "username@gmail.com", "pass-to-gmail", ImapClient.AuthMethods.Login, 993, true))
{
ic.SelectMailbox("INBOX");
msgs = new List<MailMessage>(ic.GetMessageCount());
msgs = ic.GetMessages(0, 100, false, true).ToList();
ic.Disconnect();
}
return msgs;
}