views:

82

answers:

1

Hi I am new to c# and have been asked to read in the title and contents of emails that arrive in a particular email account and them store them in SQL. I initially thought this must be easy but I cannot find any simple tutorials or samples.

Can anyone help?

A: 

Check HERE: something similar already discussed. Mainly, you can use :

If you will use EWS here is some sample :

    ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1); // depends from Exchange server version 
    //service.Credentials = new NetworkCredential( "{Active Directory ID}", "{Password}", "{Domain Name}" );
    service.AutodiscoverUrl( "[email protected]" );
    FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Inbox,
          new ItemView( 10 ) );
    foreach ( Item item in findResults.Items )
    {
       Console.WriteLine( item.Subject );
    }
Incognito
Ok thanks for the help. I have since been told the exchange servers only have IMAP, the servers are a mix of exchange 2003 and 2007.So I am looking for some sample code for IMAP, either in C# or vbscript. Also there is no budget to buy libraries etc. I'm quite stuck here, any other helpful links would be greatfully received.Thanks
Mick W