I am trying to write a class to read email from a pop3 server and I am trying to read information from my gmail account. But everytime I get to the line indicated I get the following error I am not sure how to combat this problem.


"Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host."

Here is the code I am trying to make the initial connection.
VB Code:
  1. Private _Server As TcpClient
  2.     Private _NetStrm As NetworkStream
  3.     Private _ReadStrm As StreamReader
  4.     Private _IncommingData As Byte()
  5.     Private _Password as String
  6.     Private _Username as String
  7.     Private Const CRLF As String = vbCrLf
  8.  
  9.     Public Function Connect() As Boolean
  10. ' create server POP3 with port 110
  11.         _Server = New TcpClient("pop.gmail.com", 110)
  12.  
  13.         Try
  14.             _NetStrm = _Server.GetStream()          
  15.             _ReadStrm = New StreamReader(_Server.GetStream())
  16.  
  17.             'Login Process
  18.             Dim Data As String = "USER " & _Username & CRLF
  19.  
  20.             _IncommingData = System.Text.Encoding.ASCII.GetBytes(Data.ToCharArray())
  21.             _NetStrm.Write(_IncommingData, 0, _IncommingData.Length)
  22.  
  23.             Data = "PASS " & _Password & CRLF
  24.             _IncommingData = System.Text.Encoding.ASCII.GetBytes(Data.ToCharArray())
  25.             _NetStrm.Write(_IncommingData, 0, _IncommingData.Length)'Error Here
  26.  
  27.             'Send STAT command to get information ie: number of mail and size
  28.             Data = "STAT" + CRLF
  29.             _IncommingData = System.Text.Encoding.ASCII.GetBytes(Data.ToCharArray())
  30.             _NetStrm.Write(_IncommingData, 0, _IncommingData.Length)
  31.  
  32.         Catch ex As Exception
  33.             Return False
  34.         End Try
  35.         Return True
  36. End Function

Thanks In Advance