How to receive emails from a POP3 server in VB.NET. You will need the POP3.vb class to access the POP3 functions, which is available from the programs section of my website: http://ah33t3r.webs.com/
The code for the program is: If TxtServer.Text = Nothing Or TxtUsername.Text = Nothing Or TxtPassword.Text = Nothing Then MsgBox("One or more of the required boxes have not been filled out", vbInformation, "Box Empty") Else Dim POPConnection As New POP3 Dim MailMessage As New EmailMessage Dim MailCount As Integer Dim MContent As String Dim MFrom As String Dim MSubject As String Dim MTo As String Dim MBody As String POPConnection.POPConnect(TxtServer.Text, TxtUsername.Text, TxtPassword.Text) MailCount = POPConnection.GetMailStat() For i = 1 To MailCount MContent = POPConnection.GetMailMessage(i) MFrom = MailMessage.ParseEmail(MContent, "From:") MSubject = MailMessage.ParseEmail(MContent, "Subject:") MTo = MailMessage.ParseEmail(MContent, "To:") MBody = MailMessage.ParseBody() MsgBox(MSubject & " - " & MFrom & " - " & MTo) Next End If
Be sure to visit my site at http://ah33t3r.webs.com
EDIT: Here's the instructions on how to use Gmail with this:
For Gmail, put in the following information:
Server: pop.gmail.com (im not sure if it will work yet because Gmail needs SSL)
Username: full email address (eg. example@gmail.com)
Password: your Gmail password
If you need more info look at this Gmail help page: http://mail.google.com/support/bin/answer.py?answer=13287
EDIT 2: I may not be making a part 2 of this after all, because now that school has started, I don't have a whole lot of time to make long videos like this. I will try to get a part 2 done sometime, but I just don't know if I'll have the time. I can still make shorter videos though.
I have used hotmail:
pop3.live.com, Port 995
and it freezes then says "POP3 ERROR- Unexpected response from mail server when connecting"
curlyfries0511 2 months ago
@curlyfries0511 Ok I will try to find out what's wrong with it. Have you looked at this info needed to connect to Hotmail with POP3: h()ttp://lifehacker.()com/5151551/hotmail-enables-pop3-for-us-users (remove the ()'s)
megalegend57 1 month ago
@hylandsjgcn I have added instructions to the description for how to use Gmail with this
megalegend57 5 months ago