views:

262

answers:

2

One year ago Mitchel Sellers had a related question...

I would like to access the Google IMAP for sending and receiving email messages within my custom application.

The point is that i would not like to use any third party controls.

Newer versions of the .Net Framework support IMAP? What options do i have?

+2  A: 

There used to be the Indy components for Borland Delphi which have been ported to C# and .NET.

There is no native support for this, As far as I know.

Workshop Alex
A: 

There is no IMAP support in current versions of .NET and I have not heard about any plans to add such support to the framework. You have to try one of third party components.

You may check our Rebex Secure Mail.

Following code shows how to download messages from the Inbox folder:

// create client, connect and log in 
Imap client = new Imap();
client.Connect("imap.example.org");
client.Login("username", "password");

// select folder 
client.SelectFolder("Inbox");

// get message list 
ImapMessageCollection list = client.GetMessageList(ImapListFields.Fast);

if (list.Count == 0)
{
    Console.WriteLine("There are no messages in the mailbox.");
}
else 
{
    // download the first message 
    MailMessage message = client.GetMailMessage(list[0].SequenceNumber);
    ...
}

Trial can be downloaded from www.rebex.net/secure-mail.net/

You may also enjoy Rebex Q&A forum which runs on similar engine as this site.

Martin Vobr