Vb.net – How To read Emails in vb.net 2005

emailvb.net

How can I read Emails in vb.net 2005 (without Using Third Party Control). Please Any idea and source code Give to me.(Any Method)

Best Answer

First of all there are multiple protocols to retreive mail:

POP3, IMAP, etc...

I suggest you start by familiarizing yourself with the various components that make up an e-mail system.

  • Mail Transfer Agent (Protocol: SMTP)
  • Mail Delivery Agent (Protocols: POP3, IMAP)
  • Mail User Agent (Outlook, Webmail, Thunderbird, your application)

Basically what you are trying to write is a Mail User Agent. A mail user agent has to "fetch" the mails from a Mail Delivery Agent using either POP or IMAP.

This means you will have to learn about these two protocols:

POP3 RFC: http://www.faqs.org/rfcs/rfc1939.html

IMAPv4 RFC: http://james.apache.org/server/rfclist/imap4/rfc2060.txt

Since e-mail communication happens using TCP/IP you will have to learn how to use the classes in the System.Net.Sockets namespace.

Take a look at the TcpClient class: http://james.apache.org/server/rfclist/imap4/rfc2060.txt

Try to understand these concepts first and then I suggest you start out with POP3, this protocol is quite easy. If you have problems then with very specific TcpClient code please update your question or post a new question.

Hope this sets you on the right track.