We have a windows service that uses OpenPop to check an email account and process some email on a regular basis. We've been using it for years and had zero issues. This weekend we moved to a new server (with upgraded Windows Server 2016) and suddenly this service is reporting the error: Authentication failed because the remote party has closed the transport stream.
We do use a secure connection to the mail server (Outlook) and I've tried to set the SecurityProtocol as seen on other SO threads and no luck:
Pop3Client client = new Pop3Client();
try
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
client.Connect(this.MailServer, popport, popsecure);
client.Authenticate(this.MailUN, this.MailPW);
}
catch (Exception ex)
{
log.Debug("Cannot connect to POP: " + ex.Message);
return;
}
I'm not even sure what's going on, let alone know what to do next to debug it. And the service still runs fine still on the old server, but I can't run it there much longer.