Question Connecting to email server using IMAP

graham23s

Member
Joined
Feb 22, 2009
Messages
13
Programming Experience
1-3
Hi Guys,

I have been trying to do this for day snow but iu keep coming up against brick walls lol, i have downloaded a few .dd's the latest being from: Connecting with IMAP Server - Aspose.Email for .NET - Documentation - Aspose.com i downloaded the files and added a reference as shown, there is very little classes or available documentation on how to connetc to a server and download emails (that i can see!)

After adding a reference aboove my basic code is:

VB.NET:
Imports System.IO
Imports System.Net.Sockets
Imports System.Text
Imports System.Net.Security
Imports System.Net
Imports System.Text.RegularExpressions
Imports Aspose.Email.Imap

Public Class formMain

    Private Sub mainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles getMailButton.Click

        'Create an imapclient with host, user and password
        Dim client As ImapClient = New ImapClient("imap.aol.com", "xxxxxxxxxx@aol.co.uk", "october")
        Try
            Console.WriteLine("Connecting to the IMAP server")
            'Connect to the remote server.
            'Note:If you use Connect(true), it will invoke the login internal.
            '        Otherwise, you need to call login sequentially.
            client.Connect()
            Console.WriteLine("Connected to the IMAP server")

            'login to the remote server.
            client.Login()

            System.Console.WriteLine("Logged in to the IMAP server")

            'Disconnect to the remote Imap server
            client.Disconnect()
            System.Console.WriteLine("Disconnected from the IMAP server")
        Catch ex As Exception
            System.Console.Write(ex.ToString())
        End Try


    End Sub

End Class

Once i click the "download emails" button nothing happens, this hapopens with all the 3 .dll examples i have tried can anyone see anything wrong with my code, it doesn't even popup any errors just nothing, also is there any tutorials on how to connect to a server via imap i could read, i can't believe the little documentation there is out there on this for visual basic net unless i'm searching for the wrong thing lol


cheers guys

Graham
 
Back
Top