andyedinborough / aenetmail

C# POP/IMAP Mail Client
369 stars 153 forks source link

Getting "An existing connection was forcibly closed by the remote host" error #198

Closed grayspace closed 7 years ago

grayspace commented 7 years ago

Here is my code:

using (var ic = new AE.Net.Mail.ImapClient("imap.gmail.com", "email", "pass", AE.Net.Mail.AuthMethods.Login, 993, true))
{
  ic.SelectMailbox("INBOX");
  AE.Net.Mail.MailMessage[] mm = ic.GetMessages(0, 10);

 return mm;
}

Here is the error I am getting at TestClient.cs line 87:

"Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."

Any suggestions?

Thanks!

grayspace commented 7 years ago

Turned out to be the firewall blocking the port. Closed.