In the .NET framework there is a class TcpClient to retrieve emails from an email server. The TcpClient class has 4 constructors to connect with the se
You can wrap the NetworkStream provided by TcpClient with an SslStream. This will provide the necessary handling of SSL and certificates.
You may have to insert some handler code to perform a certificate validation callback, e.g. through ServicePointManager.ServerCertificateValidationCallback.