Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. I cannot establish a connection to pop3 server !!!

I cannot establish a connection to pop3 server !!!

Scheduled Pinned Locked Moved C#
helpsecuritysysadminquestionworkspace
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mohadcs
    wrote on last edited by
    #1

    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);

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups