This is a code that connects to gmail, passes my username and password then retrieve the response. It seems to be working fine but the problem is the response. I was instructed that the response should be like "+OK" or "-Err", instead it shows weird characters. A fellow told me that there must be a problem with the encoding... So here it is... please help me...
This is my code:
Dim _server As TcpClient
Dim _netstream As NetworkStream
Dim _stmreader As StreamReader
Dim _senddata() As Byte
Dim _ssl As Net.Security.SslStream
Dim _user, _password As String
Try
_server = New TcpClient("pop.gmail.com", 995)
_netstream = _server.GetStream
_ssl = New Net.Security.SslStream(_server.GetStream())
DirectCast(_ssl, Net.Security.SslStream).AuthenticateAsClient("pop.gmail.com")
_stmreader = New StreamReader(_server.GetStream)
Catch _ex As Exception
MsgBox(_ex.Message)
Exit Sub
End Try