Solved

How can I recieve/download e-mail into my VB.NET 2008 application?

Posted on 2009-05-08
3
751 Views
Last Modified: 2013-11-29
I am trying to develop a VB.NET application that responds to a user via text message with their "status" for today. I can get the text message sent, that's not the problem. However when they want to check their status... they send their ID# to an SMS site, which is then forwarded to an e-mail. How can I download those e-mails automatically and use the data in the body? Right now I have them all being forwarded to a Gmail account but I can change that if I have to.....
0
Comment
Question by:jeremy092288
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Expert Comment

by:MatthiasVance
ID: 24343366
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 250 total points
ID: 24345824
Here is some code which could be used to download emails from gmail.

http://www.example-code.com/vbdotnet/pop3_gmail.asp
http://www.example-code.com/vbdotnet/email.asp
http://www.a1vbcode.com/snippet-3383.asp
http://www.codeproject.com/KB/IP/QMailClient.aspx
http://www.jscape.com/articles/retrieving_email_pop3_vb.html
http://www.a1vbcode.com/app-3637.asp
' The mailman object is used for receiving (POP3)
' and sending (SMTP) email.
Dim mailman As New Chilkat.MailMan()
 
' Any string argument automatically begins the 30-day trial.
Dim success As Boolean
success = mailman.UnlockComponent("30-day trial")
If (success <> true) Then
    MsgBox("Component unlock failed")
    Exit Sub
End If
 
 
' Set the GMail account POP3 properties.
mailman.MailHost = "pop.gmail.com"
mailman.PopUsername = "****"
mailman.PopPassword = "****"
mailman.PopSsl = true
mailman.MailPort = 995
 
Dim bundle As Chilkat.EmailBundle
' Read mail headers and one line of the body.
' To get the full emails, call CopyMail instead (no arguments)
bundle = mailman.GetAllHeaders(1)
 
If (bundle Is Nothing ) Then
    MsgBox(mailman.LastErrorText)
    Exit Sub
End If
 
 
Dim i As Integer
Dim email As Chilkat.Email
For i = 0 To bundle.MessageCount - 1
    email = bundle.GetEmail(i)
 
    ' Display the From email address and the subject.
    TextBox1.Text = TextBox1.Text & email.From & vbCrLf
    TextBox1.Refresh()
    TextBox1.Text = TextBox1.Text & email.Subject _
         & vbCrLf & vbCrLf
    TextBox1.Refresh()
 
Next

Open in new window

0
 
LVL 8

Expert Comment

by:MatthiasVance
ID: 24352455
Note that this code only applies if you want to use third party components, which you have to buy.

Regards,

Matthias
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question