EWS

pub build coverage license

This project is a Dart client library to access Microsoft Exchange web services. The library works against Office 365 Exchange Online as well as on premises Exchange. By using it you can access almost all the information stored in an Office 365, Exchange Online, or Exchange Server mailbox. However, this API is in sustaining mode, the recommended access pattern for Office 365 and Exchange online data is Microsoft Graph

Getting started

In the library the ExchangeService class contains the methods and properties that are used to set user credentials, identify the Exchange Web Services endpoint, send and receive SOAP messages, and configure the connection with Exchange Web Services. To perform an operation by using the library, you must set up the ExchangeService class.

final service = ExchangeService.withVersion(ExchangeVersion.Exchange2007_SP1)
    ..Url = Uri.parse("https://outlook.office365.com/ews/exchange.asmx")
    ..Credentials = WebCredentials("---USER_NAME---", "---USER_PASSWORD---", "---USER_DOMAIN---");

Creating folders

The following code example shows how to create a folder with a custom folder class.

final folder = new Folder(service)
    ..DisplayName = "Custom Folder"
    ..FolderClass = "IPF.MyCustomFolderClass";
await folder.SaveWithWellKnownFolderName(WellKnownFolderName.Notes);

Creating custom extended properties

The following code example shows how to create a new extended property, set a value for the extended property, and add it to a message.

// Create a definition for the extended property.
final extendedPropertyDefinition = ExtendedPropertyDefinition.withDefaultPropertySetAndName(DefaultExtendedPropertySet.Common, "custom:MeetingDescription", MapiPropertyType.String);

// Create an e-mail message that you will add the extended property to.
final message = new EmailMessage(service)
    ..Subject = "Saved with the meeting description"
    ..Body = MessageBody.withText("The meeting description is contained within the extended property.")
    ..ToRecipients.Add(EmailAddress(smtpAddress: "user@contoso.com"))
    ..SetExtendedProperty(extendedPropertyDefinition, "The meeting purpose is make the right decision");

// Save the e-mail message.
await message.SendAndSaveCopy();

Creating an appointment

The following code shows how to create an appointment and set a subject, a body, a start time, and an end time to one.

final startTime = new DateTime(2019, 9, 9, 9, 10, 0);
final appointment = new Appointment(service)
  ..Subject = "Dentist Appointment"
  ..Body = MessageBody.withText("The appointment is with Dr. Smith.")
  ..Start = startTime
  ..End = startTime.add(Duration(hours: 2));

await appointment.SaveWithSendInvitationsMode(SendInvitationsMode.SendToNone);

Support statement

Starting July 19th 2018, Exchange Web Services (EWS) will no longer receive feature updates. While the service will continue to receive security updates and certain non-security updates, product design and features will remain unchanged. This change also applies to the EWS SDKs for Java and .NET. More information here: https://developer.microsoft.com/en-us/graph/blogs/upcoming-changes-to-exchange-web-services-ews-api-for-office-365/

Additional resources

See the following articles to help you get started:

Documentation

Documentation for the EWS Managed API is available in the Web services node of the MSDN Library. In addition to the getting started links provided, you can find how to topics and code samples for the most frequently used EWS Managed API objects in the Develop node. All the latest information about the EWS Managed API, EWS, and related web services can be found under the Explore the EWS Managed API, EWS, and web services in Exchange topic on MSDN.

Libraries

Attributes/EwsEnumAttribute
Attributes/ServiceObjectDefinitionAttribute
Autodiscover/AlternateMailbox
Autodiscover/AlternateMailboxCollection
Autodiscover/AutodiscoverDnsClient
Autodiscover/AutodiscoverError
Autodiscover/AutodiscoverResponseCollection
Autodiscover/AutodiscoverService
Autodiscover/ConfigurationSettings/ConfigurationSettingsBase
Autodiscover/ConfigurationSettings/Outlook/OutlookAccount
Autodiscover/ConfigurationSettings/Outlook/OutlookConfigurationSettings
Autodiscover/ConfigurationSettings/Outlook/OutlookProtocol
Autodiscover/ConfigurationSettings/Outlook/OutlookUser
Autodiscover/DocumentSharingLocation
Autodiscover/DocumentSharingLocationCollection
Autodiscover/DomainSettingError
Autodiscover/ProtocolConnection
Autodiscover/ProtocolConnectionCollection
Autodiscover/Requests/AutodiscoverRequest
Autodiscover/Requests/GetDomainSettingsRequest
Autodiscover/Requests/GetUserSettingsRequest
Autodiscover/Responses/AutodiscoverResponse
Autodiscover/Responses/GetDomainSettingsResponse
Autodiscover/Responses/GetDomainSettingsResponseCollection
Autodiscover/Responses/GetUserSettingsResponse
Autodiscover/Responses/GetUserSettingsResponseCollection
Autodiscover/UserSettingError
Autodiscover/WebClientUrl
Autodiscover/WebClientUrlCollection
ComplexProperties/AppointmentOccurrenceId
ComplexProperties/ApprovalRequestData
ComplexProperties/ArchiveTag
ComplexProperties/Attachment
ComplexProperties/AttachmentCollection
ComplexProperties/Attendee
ComplexProperties/AttendeeCollection
ComplexProperties/AttributedString
ComplexProperties/AttributedStringCollection
ComplexProperties/Attribution
ComplexProperties/AttributionCollection
ComplexProperties/CompleteName
ComplexProperties/ComplexProperty
ComplexProperties/ComplexPropertyCollection
ComplexProperties/ConversationId
ComplexProperties/DeletedOccurrenceInfo
ComplexProperties/DeletedOccurrenceInfoCollection
ComplexProperties/DictionaryEntryProperty
ComplexProperties/DictionaryProperty
ComplexProperties/EmailAddress
ComplexProperties/EmailAddressCollection
ComplexProperties/EmailAddressDictionary
ComplexProperties/EmailAddressEntry
ComplexProperties/EnhancedLocation
ComplexProperties/ExtendedProperty
ComplexProperties/ExtendedPropertyCollection
ComplexProperties/FileAttachment
ComplexProperties/Flag
ComplexProperties/FolderId
ComplexProperties/FolderIdCollection
ComplexProperties/FolderPermission
ComplexProperties/FolderPermissionCollection
ComplexProperties/GroupMember
ComplexProperties/GroupMemberCollection
ComplexProperties/HighlightTerm
ComplexProperties/IComplexPropertyChangedDelegate
ComplexProperties/ImAddressDictionary
ComplexProperties/ImAddressEntry
ComplexProperties/IServiceObjectChangedDelegate
ComplexProperties/ItemAttachment
ComplexProperties/ItemCollection
ComplexProperties/ItemId
ComplexProperties/ItemIdCollection
ComplexProperties/Mailbox
ComplexProperties/MeetingTimeZone
ComplexProperties/MessageBody
ComplexProperties/MimeContent
ComplexProperties/MimeContentBase
ComplexProperties/OccurrenceInfo
ComplexProperties/OccurrenceInfoCollection
ComplexProperties/OnlineMeetingSettings
ComplexProperties/PersonaPostalAddress
ComplexProperties/PhoneNumberDictionary
ComplexProperties/PhoneNumberEntry
ComplexProperties/PhysicalAddressDictionary
ComplexProperties/PhysicalAddressEntry
ComplexProperties/Recurrence/Patterns/Recurrence
ComplexProperties/Recurrence/Patterns/Recurrence.IntervalPattern
ComplexProperties/Recurrence/Patterns/Recurrence.MonthlyPattern
ComplexProperties/Recurrence/Ranges/EndDateRecurrenceRange
ComplexProperties/Recurrence/Ranges/NoEndRecurrenceRange
ComplexProperties/Recurrence/Ranges/NumberedRecurrenceRange
ComplexProperties/Recurrence/Ranges/RecurrenceRange
ComplexProperties/RecurringAppointmentMasterId
ComplexProperties/ReferenceAttachment
ComplexProperties/RetentionTagBase
ComplexProperties/SearchFolderParameters
ComplexProperties/ServiceId
ComplexProperties/StringList
ComplexProperties/TextBody
ComplexProperties/TimeChange
ComplexProperties/TimeChangeRecurrence
ComplexProperties/TimeZones/AbsoluteDateTransition
ComplexProperties/TimeZones/AbsoluteDayOfMonthTransition
ComplexProperties/TimeZones/AbsoluteMonthTransition
ComplexProperties/TimeZones/RelativeDayOfMonthTransition
ComplexProperties/TimeZones/TimeZoneDefinition
ComplexProperties/TimeZones/TimeZonePeriod
ComplexProperties/TimeZones/TimeZoneTransition
ComplexProperties/TimeZones/TimeZoneTransitionGroup
ComplexProperties/UniqueBody
ComplexProperties/UserId
Core/EwsServiceMultiResponseXmlReader
Core/EwsServiceXmlReader
Core/EwsServiceXmlWriter
Core/EwsUtilities
Core/EwsXmlReader
Core/ExchangeServerInfo
Core/ExchangeService
Core/ExchangeServiceBase
Core/LazyMember
Core/PropertyBag
Core/PropertySet
Core/Requests/CreateAttachmentRequest
Core/Requests/CreateFolderRequest
Core/Requests/CreateItemRequest
Core/Requests/CreateItemRequestBase
Core/Requests/CreateRequest
Core/Requests/CreateResponseObjectRequest
Core/Requests/DeleteAttachmentRequest
Core/Requests/DeleteFolderRequest
Core/Requests/DeleteItemRequest
Core/Requests/DeleteRequest
Core/Requests/EmptyFolderRequest
Core/Requests/FindFolderRequest
Core/Requests/FindItemRequest
Core/Requests/FindRequest
Core/Requests/GetAttachmentRequest
Core/Requests/GetFolderRequest
Core/Requests/GetFolderRequestBase
Core/Requests/GetFolderRequestForLoad
Core/Requests/GetItemRequest
Core/Requests/GetItemRequestBase
Core/Requests/GetItemRequestForLoad
Core/Requests/GetRequest
Core/Requests/GetStreamingEventsRequest
Core/Requests/HangingServiceRequestBase
Core/Requests/MultiResponseServiceRequest
Core/Requests/ResolveNamesRequest
Core/Requests/SendItemRequest
Core/Requests/ServiceRequestBase
Core/Requests/SimpleServiceRequestBase
Core/Requests/SubscribeRequest
Core/Requests/SubscribeToStreamingNotificationsRequest
Core/Requests/SyncFolderHierarchyRequest
Core/Requests/SyncFolderItemsRequest
Core/Requests/UnsubscribeRequest
Core/Requests/UpdateFolderRequest
Core/Requests/UpdateItemRequest
Core/Responses/CreateAttachmentResponse
Core/Responses/CreateFolderResponse
Core/Responses/CreateItemResponse
Core/Responses/CreateItemResponseBase
Core/Responses/CreateResponseObjectResponse
Core/Responses/DeleteAttachmentResponse
Core/Responses/FindFolderResponse
Core/Responses/FindItemResponse
Core/Responses/GetAttachmentResponse
Core/Responses/GetFolderResponse
Core/Responses/GetItemResponse
Core/Responses/GetStreamingEventsResponse
Core/Responses/IGetObjectInstanceDelegate
Core/Responses/ResolveNamesResponse
Core/Responses/ServiceResponse
Core/Responses/ServiceResponseCollection
Core/Responses/SubscribeResponse
Core/Responses/SyncFolderHierarchyResponse
Core/Responses/SyncFolderItemsResponse
Core/Responses/SyncResponse
Core/Responses/UpdateFolderResponse
Core/Responses/UpdateItemResponse
Core/ServiceObjects/Folders/CalendarFolder
Core/ServiceObjects/Folders/ContactsFolder
Core/ServiceObjects/Folders/Folder
Core/ServiceObjects/Folders/SearchFolder
Core/ServiceObjects/Folders/TasksFolder
Core/ServiceObjects/Items/Appointment
Core/ServiceObjects/Items/Contact
Core/ServiceObjects/Items/ContactGroup
Core/ServiceObjects/Items/EmailMessage
Core/ServiceObjects/Items/Item
Core/ServiceObjects/Items/MeetingCancellation
Core/ServiceObjects/Items/MeetingMessage
Core/ServiceObjects/Items/MeetingRequest
Core/ServiceObjects/Items/MeetingResponse
Core/ServiceObjects/Items/Task
Core/ServiceObjects/ResponseObjects/AcceptMeetingInvitationMessage
Core/ServiceObjects/ResponseObjects/CalendarResponseMessage
Core/ServiceObjects/ResponseObjects/CalendarResponseMessageBase
Core/ServiceObjects/ResponseObjects/CancelMeetingMessage
Core/ServiceObjects/ResponseObjects/DeclineMeetingInvitationMessage
Core/ServiceObjects/ResponseObjects/ResponseMessage
Core/ServiceObjects/ResponseObjects/ResponseObject
Core/ServiceObjects/Schemas/AppointmentSchema
Core/ServiceObjects/Schemas/CalendarResponseObjectSchema
Core/ServiceObjects/Schemas/CancelMeetingMessageSchema
Core/ServiceObjects/Schemas/ContactGroupSchema
Core/ServiceObjects/Schemas/ContactSchema
Core/ServiceObjects/Schemas/ConversationSchema
Core/ServiceObjects/Schemas/EmailMessageSchema
Core/ServiceObjects/Schemas/FolderSchema
Core/ServiceObjects/Schemas/ItemSchema
Core/ServiceObjects/Schemas/MeetingCancellationSchema
Core/ServiceObjects/Schemas/MeetingMessageSchema
Core/ServiceObjects/Schemas/MeetingRequestSchema
Core/ServiceObjects/Schemas/MeetingResponseSchema
Core/ServiceObjects/Schemas/PersonaSchema
Core/ServiceObjects/Schemas/PostItemSchema
Core/ServiceObjects/Schemas/PostReplySchema
Core/ServiceObjects/Schemas/ResponseMessageSchema
Core/ServiceObjects/Schemas/ResponseObjectSchema
Core/ServiceObjects/Schemas/SearchFolderSchema
Core/ServiceObjects/Schemas/ServiceObjectSchema
Core/ServiceObjects/Schemas/TaskSchema
Core/ServiceObjects/ServiceObject
Core/ServiceObjects/ServiceObjectInfo
Core/SimplePropertyBag
Core/XmlAttributeNames
Core/XmlElementNames
Credentials/ExchangeCredentials
Enumerations/AffectedTaskOccurrence
Enumerations/AggregateType
Enumerations/AppointmentType
Enumerations/AutodiscoverEndpoints
Enumerations/AutodiscoverErrorCode
Enumerations/AutodiscoverResponseType
Enumerations/AvailabilityData
Enumerations/BasePropertySet
Enumerations/BodyType
Enumerations/ChangeType
Enumerations/ClientAccessTokenType
Enumerations/ClientExtensionProvidedTo
Enumerations/ComparisonMode
Enumerations/ConflictResolutionMode
Enumerations/ConflictType
Enumerations/ConnectingIdType
Enumerations/ConnectionFailureCause
Enumerations/ConsentState
Enumerations/ContactSource
Enumerations/ContainmentMode
Enumerations/ConversationAction
Enumerations/ConversationFlagStatus
Enumerations/ConversationQueryTraversal
Enumerations/ConversationSortOrder
Enumerations/DateTimePrecision
Enumerations/DayOfTheWeek
Enumerations/DayOfTheWeekIndex
Enumerations/DefaultExtendedPropertySet
Enumerations/DelegateFolderPermissionLevel
Enumerations/DeleteMode
Enumerations/DomainSettingName
Enumerations/EffectiveRights
Enumerations/ElcFolderType
Enumerations/EmailAddressKey
Enumerations/EmailPosition
Enumerations/Enumerations
Enumerations/EventType
Enumerations/ExchangeVersion
Enumerations/ExtensionInstallScope
Enumerations/ExtensionType
Enumerations/FileAsMapping
Enumerations/FlaggedForAction
Enumerations/FolderPermissionLevel
Enumerations/FolderPermissionReadAccess
Enumerations/FolderTraversal
Enumerations/FreeBusyViewType
Enumerations/GetUserPhotoStatus
Enumerations/HoldAction
Enumerations/HoldStatus
Enumerations/IconIndex
Enumerations/IdFormat
Enumerations/ImAddressKey
Enumerations/Importance
Enumerations/ItemFlagStatus
Enumerations/ItemTraversal
Enumerations/LegacyFreeBusyStatus
Enumerations/LobbyBypass
Enumerations/LocationSource
Enumerations/LogicalOperator
Enumerations/MailboxSearchLocation
Enumerations/MailboxSearchScopeType
Enumerations/MailboxType
Enumerations/MapiPropertyType
Enumerations/MeetingAttendeeType
Enumerations/MeetingRequestsDeliveryScope
Enumerations/MeetingRequestType
Enumerations/MemberStatus
Enumerations/MessageDisposition
Enumerations/Month
Enumerations/OffsetBasePoint
Enumerations/OnlineMeetingAccessLevel
Enumerations/OofExternalAudience
Enumerations/OofState
Enumerations/OutlookProtocolType
Enumerations/PeopleQueryContextKeys
Enumerations/PeopleQuerySource
Enumerations/PermissionScope
Enumerations/PhoneCallState
Enumerations/PhoneNumberKey
Enumerations/PhysicalAddressIndex
Enumerations/PhysicalAddressKey
Enumerations/Presenters
Enumerations/PreviewItemBaseShape
Enumerations/PrivilegedLogonType
Enumerations/PropertyDefinitionFlags
Enumerations/ResolveNameSearchLocation
Enumerations/ResponseActions
Enumerations/ResponseMessageType
Enumerations/ResponseType
Enumerations/RetentionActionType
Enumerations/RetentionType
Enumerations/RuleErrorCode
Enumerations/RuleProperty
Enumerations/SearchFolderTraversal
Enumerations/SearchPageDirection
Enumerations/SearchResultType
Enumerations/SendCancellationsMode
Enumerations/SendInvitationsMode
Enumerations/SendInvitationsOrCancellationsMode
Enumerations/SendPrompt
Enumerations/Sensitivity
Enumerations/ServiceError
Enumerations/ServiceErrorHandling
Enumerations/ServiceObjectType
Enumerations/ServiceResult
Enumerations/SetClientExtensionActionId
Enumerations/SortDirection
Enumerations/StandardUser
Enumerations/SuggestionQuality
Enumerations/SyncFolderItemsScope
Enumerations/TaskDelegationState
Enumerations/TaskMode
Enumerations/TaskStatus
Enumerations/TraceFlags
Enumerations/UserSettingName
Enumerations/ViewFilter
Enumerations/WellKnownFolderName
Enumerations/XmlNamespace
ews
Exceptions/AccountIsLockedException
Exceptions/ArgumentException
Exceptions/ArgumentNullException
Exceptions/AutodiscoverLocalException
Exceptions/AutodiscoverRemoteException
Exceptions/AutodiscoverResponseException
Exceptions/BatchServiceResponseException
Exceptions/CreateAttachmentException
Exceptions/DeleteAttachmentException
Exceptions/InvalidOperationException
Exceptions/NotImplementedException
Exceptions/NotSupportedException
Exceptions/PropertyException
Exceptions/ServerBusyException
Exceptions/ServiceLocalException
Exceptions/ServiceObjectPropertyException
Exceptions/ServiceRemoteException
Exceptions/ServiceRequestException
Exceptions/ServiceResponseException
Exceptions/ServiceValidationException
Exceptions/ServiceVersionException
Exceptions/ServiceXmlDeserializationException
Exceptions/ServiceXmlSerializationException
Exceptions/TimeZoneConversionException
Http/BasicCredentials
Http/CookieContainer
Http/EwsHttpClientFactory
Http/EwsHttpWebExceptionResponse
Http/EwsHttpWebRequest
Http/EwsHttpWebRequestFactory
Http/EwsHttpWebResponse
Http/HttpRequestHeader
Http/ICredentials
Http/IEwsHttpWebRequestFactory
Http/IHttpClientFactory
Http/IWebProxy
Http/OAuthCredentials
Http/WebException
Http/WebExceptionStatus
Http/WebHeaderCollection
Http/X509CertificateCollection
Interfaces/ICalendarActionProvider
Interfaces/ICustomUpdateSerializer
Interfaces/IEwsHttpWebRequest
Interfaces/IEwsHttpWebResponse
Interfaces/IFileAttachmentContentHandler
Interfaces/IOwnedProperty
Interfaces/ISearchStringProvider
Interfaces/ISelfValidate
Interfaces/ITraceListener
misc/AbstractFolderIdWrapper
misc/AbstractItemIdWrapper
misc/Availability/AttendeeInfo
misc/CalendarActionResults
misc/DelegateTypes
misc/EwsTraceListener
misc/FolderIdWrapper
misc/FolderIdWrapperList
misc/FolderWrapper
misc/HttpStatusCode
misc/IDisposable
misc/ItemIdWrapper
misc/ItemIdWrapperList
misc/ItemWrapper
misc/MapiTypeConverter
misc/MapiTypeConverterMapEntry
misc/NameResolution
misc/NameResolutionCollection
misc/Nullable
misc/OutParam
misc/Param
misc/SoapFaultDetails
misc/Std/EnumToString
misc/Std/MemoryStream
misc/StringUtils
misc/Time
misc/TimeSpan
misc/UriHelper
misc/Uuid
Notifications/FolderEvent
Notifications/GetEventsResults
Notifications/GetStreamingEventsResults
Notifications/ItemEvent
Notifications/NotificationEvent
Notifications/NotificationEventArgs
Notifications/StreamingSubscription
Notifications/StreamingSubscriptionConnection
Notifications/SubscriptionBase
Notifications/SubscriptionErrorEventArgs
PropertyDefinitions/AttachmentsPropertyDefinition
PropertyDefinitions/BoolPropertyDefinition
PropertyDefinitions/ByteArrayPropertyDefinition
PropertyDefinitions/ComplexPropertyDefinition
PropertyDefinitions/ComplexPropertyDefinitionBase
PropertyDefinitions/ContainedPropertyDefinition
PropertyDefinitions/DateTimePropertyDefinition
PropertyDefinitions/DoublePropertyDefinition
PropertyDefinitions/EffectiveRightsPropertyDefinition
PropertyDefinitions/ExtendedPropertyDefinition
PropertyDefinitions/GenericPropertyDefinition
PropertyDefinitions/ICreateComplexPropertyDelegate
PropertyDefinitions/IndexedPropertyDefinition
PropertyDefinitions/IntPropertyDefinition
PropertyDefinitions/MeetingTimeZonePropertyDefinition
PropertyDefinitions/PermissionCollectionPropertyDefinition
PropertyDefinitions/PropertyDefinition
PropertyDefinitions/PropertyDefinitionBase
PropertyDefinitions/RecurrencePropertyDefinition
PropertyDefinitions/ScopedDateTimePropertyDefinition
PropertyDefinitions/ServiceObjectPropertyDefinition
PropertyDefinitions/StartTimeZonePropertyDefinition
PropertyDefinitions/StringPropertyDefinition
PropertyDefinitions/TaskDelegationStatePropertyDefinition
PropertyDefinitions/TimeSpanPropertyDefinition
PropertyDefinitions/TimeZonePropertyDefinition
PropertyDefinitions/TypedPropertyDefinition
Search/CalendarView
Search/Filters/Filters
Search/Filters/SearchFilter
Search/Filters/SearchFilter.ContainsSubstring
Search/Filters/SearchFilter.ExcludesBitmask
Search/Filters/SearchFilter.Exists
Search/Filters/SearchFilter.IsEqualTo
Search/Filters/SearchFilter.IsGreaterThan
Search/Filters/SearchFilter.IsGreaterThanOrEqualTo
Search/Filters/SearchFilter.IsLessThan
Search/Filters/SearchFilter.IsLessThanOrEqualTo
Search/Filters/SearchFilter.IsNotEqualTo
Search/Filters/SearchFilter.Not
Search/Filters/SearchFilter.PropertyBasedFilter
Search/Filters/SearchFilter.RelationalFilter
Search/Filters/SearchFilter.SearchFilterCollection
Search/FindFoldersResults
Search/FindItemsResults
Search/FolderView
Search/GroupedFindItemsResults
Search/Grouping
Search/ItemGroup
Search/ItemView
Search/OrderByCollection
Search/PagedView
Search/SeekToConditionItemView
Search/ViewBase
Sync/Change
Sync/ChangeCollection
Sync/FolderChange
Sync/ItemChange
Xml/XmlException
Xml/XmlNode
Xml/XmlNodeType
Xml/XmlReader
Xml/XMLStreamWriter
Xml/XmlWriter