tags:

views:

42

answers:

3

Hi, I have mail server configuration data (server - user name - password - port) and i want to access it using vb.net and retrieve its mails in collection. i need to parse the email body to make some operations on it.

please i need some help, i tried to search for it but i found a complex samples.

A: 

It is possible to connect to the mail server using IMAP, check the following urls

http://www.example-code.com/vbdotnet/imap_readMail.asp http://www.codeproject.com/Messages/3146060/connecting-gmail-using-IMAP-in-VB-NET.aspx http://www.aspnetimap.com/examples.aspx

more examples at http://www.example-code.com/vbdotnet/imap.asp

Have a nice time

john
Thanks, I tried chilkat dll and its working with me . but there are two things 1- its returned just the new mails not all mails in my inbox.2- its not a free component.what shall i do .
Amr Elnashar
+1  A: 

Try to use this library, it is very suitable for that http://csharpmail.codeplex.com/

B-Rain
A: 

You may also want to try Mail.dll email component:

Using imap As New Imap
    imap.Connect("imap.server.com")
    imap.Login("user", "password")

    imap.SelectInbox()
    Dim uidList As List(Of Long) = imap.SearchFlag(Flag.Unseen)

    For Each uid As Long In uidList
        Dim email As IMail = New MailBuilder() _
            .CreateFromEml(imap.GetMessageByUID(uid))
        Console.WriteLine(email.Subject)
    Next
    imap.Close(True)
End Using   

Please note that this is a commercial product I developed.

You can download it here: http://www.lesnikowski.com/mail/

Pawel Lesnikowski