Solved

How do I colaborate with Exchange though c#?

Posted on 2011-03-02
3
360 Views
Last Modified: 2013-12-17
I want to be able to connect to some exchange account and add/remove given appointments. What do I use to do that? I found some solutions using CDOEX Library but it seems like it's  no longer supported with 2010.
0
Comment
Question by:joein610
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Expert Comment

by:pchui
ID: 35024155
If you are writing a server application, your best best is use the Exchange Web Services. EWS is intended to replace a myriad of partial Exchange APIs (CDO, CDOEX, ExOLEDB, WebDav, Exchange store event sinks). Even most MAPI tasks can be replaced with EWS.

Microsoft has created managed code wrappers to make EWS easier to work with:
http://msdn.microsoft.com/en-us/library/dd633709(v=exchg.80).aspx

Here's some sample code for creating appointments with the EWS managed API:
http://msdn.microsoft.com/en-us/library/dd633661(v=exchg.80).aspx

If you're writing a client application, then there's still the Outlook Object Model.
0
 

Author Comment

by:joein610
ID: 35028759
I managed to install Exchange API but I get some errors:

using System;
using System.Net;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Exchange.WebServices.Data;
namespace ClassLibrary1
{
    public class Class1
    {
        ExchangeService service = new ExchangeService();
        service.UseDefaultCredentials = true;
        service.Credentials = new WebCredentials("user1@contoso.com", "password");



    }
}



3-3-2011-11-26-19-AM.png
0
 
LVL 2

Accepted Solution

by:
pchui earned 500 total points
ID: 35029397
You forgot to put your statments in a function

using System;
using System.Net;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Exchange.WebServices.Data;
namespace ClassLibrary1
{
    public class Class1
    {
        void foo()
        {
            ExchangeService service = new ExchangeService();
            service.UseDefaultCredentials = true;
            service.Credentials = new WebCredentials("user1@contoso.com", "password");
        }
    }
}

Open in new window

0

Featured Post

Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question