开发者

C# reading Emails from MS Exchange

开发者 https://www.devze.com 2022-12-31 04:51 出处:网络
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开发者_JAVA百科

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开发者_JAVA百科 easy but I cannot find any simple tutorials or samples.

Can anyone help?


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

  • Exchange Web Services Managed API
  • IMAP
  • POP3

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( "First.Last@MyCompany.com" );
    FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Inbox,
          new ItemView( 10 ) );
    foreach ( Item item in findResults.Items )
    {
       Console.WriteLine( item.Subject );
    }
0

精彩评论

暂无评论...
验证码 换一张
取 消