How do I create outlook appointments with c# in exchange?

What is the easiest way to get it to work? I've been playing with Microsoft.Exchange.WebServices.Data; and it seems like this is the way to go.

Who is Participating?
pchuiConnect With a Mentor Commented:
It should be pretty similar to the AssemblyInfo.cs in your project. AssemblyInfo.cs
This is the documentation for creating appointments with the EWS Managed API:

I assume that you are writing a server app, so you'll need to to create appointments for other users. In which case, you'll also need to incorporate impersonation:

If you are writing a client app, just use the Outlook Object Model. This example is VB.NET, but you get the idea...
The new generation of project management tools

With’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

joein610Author Commented:
Thank you for all the info. I'm trying to get it to work but it gets me an error all the time. I attached the API dll file but it seems like it doesn't work properly. Take a look at the screen shots
Looks like you added the reference correctly, so I don't see why Visual Studio is complaining. Is Microsoft.Exchange.WebServices in the Object Browser (like in my screen shot)?
joein610Author Commented:
Yes it is. Is there anything else I can do to try to get this to work?
joein610Author Commented:
This is how it looks like..
Try building my project file. It assumes that the Microsoft.Exchange.WebServices.dll is in a subfolder named "EWS".

 EwsManagedTest.csproj Program.cs
joein610Author Commented:
Good Morning, I tried yours but  I got another error. I'm attaching my project + the screen shoot of the error.

The whole project is located here:

joein610Author Commented:
It worked. Thank you very much for your help. This is my code for any future reference:

using System;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using Microsoft.Exchange.WebServices.Data;

namespace EwsManagedTest
    class Program
        static void Main(string[] args)
            ServicePointManager.ServerCertificateValidationCallback +=
                object sender,
                X509Certificate certificate,
                X509Chain chain,
                SslPolicyErrors sslPolicyErrors)
                return true;

            string userName = "login";
            string password = "password";
            string domain = "";
            string exchangeWebServiceUrl = "IPADDRESS/ews/exchange.asmx";
            ExchangeService service = new ExchangeService();
            service.Credentials = new WebCredentials(userName, password, domain);
            service.Url = new Uri(exchangeWebServiceUrl);

            Appointment appointment = new Appointment(service);
            appointment.Subject = "Testing";
            appointment.Start = DateTime.Now;
            appointment.End = appointment.Start.AddHours(1);

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.