Pop3 connecting

OcLee

Newcomer
Joined
Jan 16, 2009
Messages
2
Hi, I'm Eelco and basicly new to visual basic.

I want to create an pop3 connection to receive email. I'm that far that my application will connect to my pop3 account. But then what, how can i recieve what the pop3 does or say,
i.e. when i'm connecting with USER user.(myname) pass.(mypass) and everything is ok. Then pop3 will send +OK back, how can I collect that within vb.net?

I thirst checked this out with TELNET and there I recieve +ok .

Hope you guys can help me with this.


Code:
 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
       
        Dim client As New TcpClient
        client.Connect("Pop3.whatever.com", 110)

        If client.Connected = True Then

            Dim stream As NetworkStream = client.GetStream()
            Dim data As Byte() = System.Text.Encoding.ASCII.GetBytes("USER user.(myusername) pass.(mypassword)")

            stream.Write(data, 0, data.Length)



            MessageBox.Show(" Connected to  " & client.ToString)
        End If
    End Sub


Edit: 21:01

Sorry I was so eager to set my thread that it is in the wrong category, sorry for that.
 
Thnx.

But I figured it out, sort of.

This is what i'm using now.
Code:
 Sub Connect()
            Dim message As String = String.Empty
            Dim pop3 As New TcpClient
            Dim data As [Byte]() = System.Text.Encoding.ASCII.GetBytes(Message)

            Dim response As String = String.Empty
          

            Try
                pop3.Connect(pop3_setting, 110)
                Dim stream As NetworkStream = pop3.GetStream()
                data = New [Byte](256) {}
                Dim bytes As Int32 = stream.Read(data, 0, data.Length)
                response = System.Text.Encoding.ASCII.GetString(data, 0, bytes)
                Form1.TextBox4.AppendText(response)
            Catch ex As Exception

            End Try
 
Back
Top