Solved

How do I colaborate with Exchange though c#?

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Question! 4 36
Simple Injector with Web Service 4 41
Modal Popup Extender control 1 20
transaction in asp.net, sql server 6 33
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 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