var m_oImapServ = new TcpClient("imap.gmail.com", "995"); var sslStrm = new SslStream(m_oImapServ.GetStream(),false); sslStrm.ReadTimeout = 30000; try { ((SslStream)sslStrm).AuthenticateAsClient("imap.gmail.com"); } catch (AuthenticationException e) { Console.WriteLine("Exception: {0}", e.Message); if (e.InnerException != null) { Console.WriteLine("Inner exception: {0}", e.InnerException.Message); } Console.WriteLine("Authentication failed - closing the connection."); m_oImapServ.Close(); return ImapResponseEnum.IMAP_FAILURE_RESPONSE; } m_oNetStrm = (Stream) sslStrm; m_oRdStrm = new StreamReader(sslStrm);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)