exchangewebservices

How can I detect if this dictionary key exists in C#?

落花浮王杯 提交于 2019-11-27 16:54:02
I am working with the Exchange Web Services Managed API, with contact data. I have the following code, which is functional , but not ideal: foreach (Contact c in contactList) { string openItemUrl = "https://" + service.Url.Host + "/owa/" + c.WebClientReadFormQueryString; row = table.NewRow(); row["FileAs"] = c.FileAs; row["GivenName"] = c.GivenName; row["Surname"] = c.Surname; row["CompanyName"] = c.CompanyName; row["Link"] = openItemUrl; //home address try { row["HomeStreet"] = c.PhysicalAddresses[PhysicalAddressKey.Home].Street.ToString(); } catch (Exception e) { } try { row["HomeCity"] = c

Get the organizer's calendar appointment using EWS for Exchange 2010

和自甴很熟 提交于 2019-11-27 16:39:52
问题 I have an synchronization application with sync appointments with Exchange 2010, and i have some questions. UserA creates an appointment and add UserB as attendee, this means UserA is the organizer of the appointment and UserB outlook calendar will have an appointment entry created. UserA and UserB calendar appointment will have their own IDs (UniqueID). If for example i am only given the ID (UniqueID) of UserB's calendar appointment, is that a method to retrieve UserA's calendar appointment?

How To Get all ITEMS from Folders and Sub-folders of PublicFolders Using EWS Managed API

早过忘川 提交于 2019-11-27 15:04:19
How to retrieve all items from "public folders" and its "sub-folders" in exchange server2010 uisng managed API??? rootfolder = Folder.Bind(service,WellKnownFolderName.PublicFoldersRoot); rootfolder.Load(); foreach (Folder folder in rootfolder.FindFolders(new FolderView(int.MaxValue))) { FindItemsResults<Item> findResults = folder.FindItems(iv); foreach (Item item in findResults) { //get item info; } } "If i do like this i am not getting items present in sub-folders of it..public folders does not support deep traversal queries too..How can i get items from sub-folders of public folders???" To

Error when I try to read/update the .Body of a Task via EWS Managed API - “You must load or assign this property before you can read its value.”

时间秒杀一切 提交于 2019-11-27 13:29:03
问题 I am using the Exchange Web Services Managed API to work with Tasks (Exchange 2007 SP1). I can create them fine. However, when I try to do updates, it works for all of the fields except for the .Body field. Whenever I try to access (read/update) that field, it gives the following error: "You must load or assign this property before you can read its value." The code I am using looks like this: //impersonate the person whose tasks you want to read Me.Impersonate(userName); //home-made function

EWS body plain text

孤者浪人 提交于 2019-11-27 12:40:55
I use EWS to get exchange emails, but how can i get plain text from email body, without html? Now i use this: EmailMessage item = (EmailMessage)outbox.Items[i]; item.Load(); item.Body.Text In the PropertySet of your item you need to set the RequestedBodyType to BodyType.Text. Here's an example: PropertySet itempropertyset = new PropertySet(BasePropertySet.FirstClassProperties); itempropertyset.RequestedBodyType = BodyType.Text; ItemView itemview = new ItemView(1000); itemview.PropertySet = itempropertyset; FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Inbox,

Exchange Web Service API and 401 unauthorized exception

断了今生、忘了曾经 提交于 2019-11-27 08:50:51
When I try sending email using the EWS API, I get the following error: (in message.Send(); ) The request failed. The remote server returned an error: (401) Unauthorized. My code is the following: ExchangeService exchangeService = new ExchangeService(ExchangeVersion.Exchange2007_SP1); //WebService Uri try { exchangeService.Url = new Uri("https://exchangeserver/ews/exchange.asmx"); } catch (Exception ex) { throw new Exception(string.Format("WebService Uri:" + ex)); } //Credentials try { exchangeService.Credentials = new WebCredentials("user@domain", "pwd", "domain"); } catch (Exception ex) {

Exchange server version “V2_22” returned for Office 365 breaks pattern - consequences?

夙愿已清 提交于 2019-11-27 08:30:07
问题 I just notice that talking to Office365 Exchange Web Services at https://outlook.office365.com/ews/exchange.asmx I get this in my SOAP response header: <Envelope> <Header> <ServerVersionInfo MajorVersion="15" MinorVersion="0" MajorBuildNumber="1049" MinorBuildNumber="23" Version="V2_22"/> </Header> This means that the Version 'schema version' property now breaks the pattern of versions that we had earlier: Exchange2007, Exchange2007_SP1, Exchange2010, Exchange2010_SP1, Exchange2010_SP2,

Exchange Web Services (EWS) API “To” header for alias

隐身守侯 提交于 2019-11-27 06:06:31
问题 I have an inbox set up in exchange, hello@mycompany.com Additionally, there is an alias for this, news@mycompany.com , so all emails to the news address end up in the hello inbox. Ideally, I want to be able to tell which alias an email has been sent to, using EWS. When I send an email to news@mycompany.com , and examine the Internet headers of the message using Microsoft Outlook, the To: header reads To: Hello <news@mycompany.com> which is exactly what I want to see. However, using EWS, when

Office 365 Rest API - Daemon week authentication

与世无争的帅哥 提交于 2019-11-27 04:40:50
I am trying to build a Ruby Daemon service to access the Office 365 rest API. It was recently made possible to do this via the OAuth 'client_credentials' flow, as detailed in this blog post: http://blogs.msdn.com/b/exchangedev/archive/2015/01/22/building-demon-or-service-apps-with-office-365-mail-calendar-and-contacts-apis-oauth2-client-credential-flow.aspx I am struggling to generate a valid access token. The token endpoint returns me a JWT however when using this token I received a 401 with this message: The access token is acquired using an authentication method that is too weak to allow

Exchange Web Service API and 401 unauthorized exception

◇◆丶佛笑我妖孽 提交于 2019-11-27 04:01:45
问题 When I try sending email using the EWS API, I get the following error: (in message.Send(); ) The request failed. The remote server returned an error: (401) Unauthorized. My code is the following: ExchangeService exchangeService = new ExchangeService(ExchangeVersion.Exchange2007_SP1); //WebService Uri try { exchangeService.Url = new Uri("https://exchangeserver/ews/exchange.asmx"); } catch (Exception ex) { throw new Exception(string.Format("WebService Uri:" + ex)); } //Credentials try {