I cannot establish a connection to pop3 server !!!
-
i use a class writen by Peter Huber, for pop3 client but i have a problem with it I cannot establish a connection throw a proxy but when i use direct connection "not firewalled or proxy environment" its work good , are there any changes must done on this method ( connect() )???? or any help please: :sigh::sigh::sigh::sigh::sigh::sigh: public void Connect() { if (pop3ConnectionState!=Pop3ConnectionStateEnum.Disconnected && pop3ConnectionState!=Pop3ConnectionStateEnum.Closed && !isTimeoutReconnect) { CallWarning("connect", "", "Connect command received, but connection state is: " + pop3ConnectionState.ToString()); } else { //establish TCP connection try { CallTrace(" Connect at port {0}", port); serverTcpConnection = new TcpClient(popServer, port); } catch (Exception ex) { throw new Pop3Exception("Connection to server "+ popServer + ", port " + port + " failed.\nRuntime Error: "+ex.ToString()); } if (useSSL) { //get SSL stream try { CallTrace(" Get SSL connection"); pop3Stream = new SslStream(serverTcpConnection.GetStream(), false); pop3Stream.ReadTimeout = readTimeout; } catch (Exception ex) { throw new Pop3Exception("Server " + popServer + " found, but cannot get SSL data stream.\nRuntime Error: "+ex.ToString()); } //perform SSL authentication try { CallTrace(" Get SSL authentication"); ((SslStream)pop3Stream).AuthenticateAsClient(popServer); } catch (Exception ex) { throw new Pop3Exception("Server " + popServer + " found, but problem with SSL Authentication.\nRuntime Error: " + ex.ToString()); } } else { //create a stream to POP3 server without using SSL try { CallTrace(" Get connection without SSL"); pop3Stream = serverTcpConnection.GetStream(); pop3Stream.ReadTimeout = readTimeout; } catch (Exception ex) { throw new Pop3Exception("Server " + popServer + " found, but cannot get data stream (without SSL).\nRuntime Error: "+ex.ToString()); } } //get stream for reading from pop server //POP3 allows only US-ASCII. The message will be translated in the proper encoding in a later step try { pop3StreamReader= new StreamReader(pop3Stream, Encoding.ASCII);