Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
Exchange Web Services .NET
>
Tutorial
> Send meeting request
The following example shows you how to send meeting request.
C# example
using System; using System.Net; using Independentsoft.Exchange; namespace Sample { class Program { static void Main(string[] args) { NetworkCredential credential = new NetworkCredential("username", "password"); Service service = new Service("https://myserver/ews/Exchange.asmx", credential); try { Appointment appointment = new Appointment(); appointment.Subject = "Meeting"; appointment.Body = new Body("Body text"); appointment.StartTime = DateTime.Today.AddHours(15); appointment.EndTime = DateTime.Today.AddHours(16); appointment.Location = "Room 123"; appointment.ReminderIsSet = true; appointment.ReminderMinutesBeforeStart = 30; appointment.RequiredAttendees.Add(new Attendee("John@mydomain.com")); appointment.OptionalAttendees.Add(new Attendee("Administrator@mydomain.com")); ItemId itemId = service.SendMeetingRequest(appointment); } catch (ServiceRequestException ex) { Console.WriteLine("Error: " + ex.Message); Console.WriteLine("Error: " + ex.XmlMessage); Console.Read(); } catch (WebException ex) { Console.WriteLine("Error: " + ex.Message); Console.Read(); } } } }
VB example
Imports System Imports System.Net Imports Independentsoft.Exchange Namespace Sample Class Module1 Shared Sub Main(ByVal args As String()) Dim credential As New NetworkCredential("username", "password") Dim service As New Service("https://myserver/ews/Exchange.asmx", credential) Try Dim appointment As New Appointment() appointment.Subject = "Meeting" appointment.Body = New Body("Body text") appointment.StartTime = DateTime.Today.AddHours(15) appointment.EndTime = DateTime.Today.AddHours(16) appointment.Location = "Room 123" appointment.ReminderIsSet = True appointment.ReminderMinutesBeforeStart = 30 appointment.RequiredAttendees.Add(New Attendee("John@mydomain.com")) appointment.OptionalAttendees.Add(New Attendee("Administrator@mydomain.com")) Dim itemId As ItemId = service.SendMeetingRequest(appointment) Catch ex As ServiceRequestException Console.WriteLine("Error: " + ex.Message) Console.WriteLine("Error: " + ex.XmlMessage) Console.Read() Catch ex As WebException Console.WriteLine("Error: " + ex.Message) Console.Read() End Try End Sub End Class End Namespace
Need help? Ask our developers:
Name*
Email*
Message*