This project is read-only.

Running the basic example code

Sep 23, 2010 at 9:40 PM

Hi folks,

 

found this library today and have problems, running the demo code. I was able to compile interimap.dll and added a reference to it in my project. Used the namespace directive and copied the code from the homepage

using System;

using System.Collections.Generic;
using System.Linq;
using System.Text;
using InterIMAP;


namespace ConsoleApplication4
{
    class Program
    {
        static void Main(string[] args)
        {
            IMAPConfig config = new IMAPConfig("imap.gmail.com", "me", "mypasswd", true, true, "INBOX");
            IMAPAsyncClient client = new IMAPAsyncClient(config, 5); // 5 represents the number of worker connections to create. Depending on your bandwidth this number might need to be adjusted for optimal performance
            client.Start();
        }
    }
}

However I get the following error message when just trying this code:

Error    2    The type or namespace name 'IMAPAsyncClient' could not be found (are you missing a using directive or an assembly reference?)

Any idea what I am doing wrong? (I use VS 20100)

Uwe

 

Nov 26, 2010 at 4:22 PM
Edited Nov 26, 2010 at 4:28 PM

IMAPAsyncClient belongs here:

 

InterIMAP.Asynchronous.Client.IMAPAsyncClient

 

Not Here:

 

InterIMAP.IMAPAsyncClient

 

So, you need to replace...

 

IMAPAsyncClient client = new IMAPAsyncClient(config, 5);

 

with something like this...        

InterIMAP.Asynchronous.Client.IMAPAsyncClient client = new InterIMAP.Asynchronous.Client.IMAPAsyncClient(config, 5);  

Or, declare...

using InterIMAP.Asynchronous.Client;