Solved

How do I colaborate with Exchange though c#?

Posted on 2011-03-02
3
355 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
  • 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now