|
|
Comments and Discussions
|
|
 |

|
Hi, copy paste images in mail body those are not display when i implemnt. in my website html editor. images src like "cid:part1.02070007.03090106@xyz.com".
|
|
|
|

|
Hi. I write client application that uses Exchange Web Services Proxy Classes in order to connect to Exchange Web Services. Sometimes, I need create MessageType object and make it looks like as received letter. Therefore I need set up such properties of EmailMessage as ReceiveBy, DateTimeCreate, DateTimeReceived, but they haven’t public set assessTherefore I need set up such properties of EmailMessage as ReceiveBy, DateTimeCreate, DateTimeReceived, but they haven’t public set assessor.
Is there any way to set up such properties with Proxy Classes?
I found resolve, but there uses Maneged API
http://ireznykov.wordpress.com/2013/03/09/set-property-of-emailmessage-in-ews/
I tried to use extended properties:
ItemType newItem = xmlParser.LoadItem(); newItem.ExtendedProperty = new ExtendedPropertyType[1];
PathToExtendedFieldType q = new PathToExtendedFieldType();
q.PropertyId = 3590; q.PropertyType = MapiPropertyTypeType.SystemTime;
q.PropertyIdSpecified = true;
newItem.ExtendedProperty[0] = new ExtendedPropertyType();
newItem.ExtendedProperty[0].ExtendedFieldURI = q;
newItem.ExtendedProperty[0].ExtendedFieldURI.DistinguishedPropertySetIdSpecified = true;
newItem.ExtendedProperty[0].Item = new System.DateTime(2014, 5, 5, 5, 5, 5).ToString("yyyy-MM-ddTHH:mm:ssZ");
CreateItemType createItemType = new CreateItemType();
...
CreateItemResponseType createItemResponse = m_mailbox.CreateItem(createItemType);
It works, but i don`t see any changes.
I tried to update items, but this properties can`t be chanded in such way.
ItemIdType itemId = new ItemIdType();
itemId.Id = savedMessageId;
itemId.ChangeKey = savedMessageChangeKey;
ItemType setCreateDT = new ItemType();
setCreateDT.DateTimeCreated = new System.DateTime(2000, 10, 10, 12, 12, 12);
setCreateDT.DateTimeCreatedSpecified = true;
SetItemFieldType setItemField = new SetItemFieldType();
setItemField.Item = new PathToUnindexedFieldType();
(setItemField.Item as PathToUnindexedFieldType).FieldURI = UnindexedFieldURIType.itemDateTimeCreated;
setItemField.Item1 = setCreateDT;
UpdateItemType request = new UpdateItemType();
request.ItemChanges = new ItemChangeType[1] { new ItemChangeType() };
request.ItemChanges[0].Item = itemId;
request.ItemChanges[0].Updates = new ItemChangeDescriptionType[1];
request.ItemChanges[0].Updates[0] = setItemField;
request.MessageDisposition = MessageDispositionType.SaveOnly;
request.MessageDispositionSpecified = true;
UpdateItemResponseType updateItemResponse = m_mailbox.UpdateItem(request);
This request returns error.
modified 15-May-13 7:27am.
|
|
|
|
|

|
i have added a web refernce of Exchange web service and given my credentials. i m able to work with this on localhost , while i am running it on server or to any other machine , its giving me an error - "The request failed with HTTP status 401: Unauthorized." things i have tried but did'nt worked - 1.enable anonymous authenication 2.given folder permission 3. used service.UseDefaultCredentials = true; please help me out , if there is any other way i can try .
|
|
|
|
|

|
In the part that explanes sending mail with attachment, there is a mistake in the comment section:
// Indicate that we only want to send the message. No copy will be saved.
request.MessageDisposition = MessageDispositionType.SaveOnly;
request.MessageDispositionSpecified = true;
it actualy saves the copy. What I want to do is sending mail with attachment without saving it to sentitems (or any other) folder. Is it possible?
Using EWS API 1.2 it can be done, so I guess it should work here also.
If I set (si=SendItemType):
si.SaveItemToFolder = False
and leave SavedItemFolderId empty (as documented in msdn), the message stays in Drafts folder.
What to do?
|
|
|
|

|
Dear All, I have an application which have users as contacts. Users are just customers who buy from my web application. I want to synch user database with Microsoft Exchange Contacts. Mean i need synching between them.. Please advise how i go about it.. Many Thanks
|
|
|
|

|
This code does not work for EWS 1.1. Please update
|
|
|
|

|
Hello;
How can send email from contact@domain.com and Name will be "Jhon Smith" or "Marry Smith". In orher words how can I display different for from Name.
Thank you!!
|
|
|
|

|
Hello,
I come to you because I have a small problem that is becoming urgent, for one of my projects at work.
I'm stuck and it becomes very urgent, I seek the way to list all emails from my inbox from a primary Exchange server and read its contents and headers ,....
I use the EWS class with a LDAP connection, I can send emails, in listing of Calendar event, to enter the Inbox (or so I think ).
Could you please help me,it's very urgent
|
|
|
|

|
Hi,
Thanks Brij for this nice article. but i need your help to understand the cause behid this Error.
"Request failed. The remote server returned an error: (401) Unauthorized".
Following is my test code.
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
service.TraceEnabled = true;
service.Credentials = new NetworkCredential("xx@abcd.com", "yyyyy", "zzzzzz");
service.Url = new Uri("https://mail.abcd.com/EWS/Exchange.asmx");
FolderView v = new FolderView(5);
ServicePointManager.ServerCertificateValidationCallback = RemoteCertificateValidationCallback;
service.FindFolders(WellKnownFolderName.Inbox, v); //Error Occurs on this line.
|
|
|
|

|
Hi Brij, we are developing a management application for exchange server. We are looking in to power shell and webservices as option. We are deciding on which to use for our applications. I have couple of questions regarding this.
1. Can we get all the information of exchange server using web services that we get from powershell.
2. Is there any information which can be retrieved from using only one of the management interface.
Thanks in advance
Viswanath
|
|
|
|

|
Hi thanks for your help so far. I can create the message, attach the file and the message sits nicely in my drafts folder. However, when I go to send it using the p_itemid, it fails with the following error:
The send or update operation could not be performed because the change key passed in the request does not match the current change key for the item
Thanks!
|
|
|
|

|
Quick question:
- Is there a way to send an email without specifying the actual email address. For example, I would like to just specify "John Doe" in the recipient and would ideally like Exchange to resolve this to john.doe@somecompany.com
How would I go about doing that in the code? Thanks for a great tutorial!
|
|
|
|

|
Hi, good article you have. Thanks.
Have you tried this against the EWS interface of MS Exchange Online service, which is obviously hosted in Microsoft cloud. I thought it would work since Exchange Online builds upon Exechange Server 2007 SP1. But when I generate the service reference in VS 2008, it doesn't even have ExchangeServiceBinding class. Do you know if SP1 has a different domain model now? Thanks.
|
|
|
|

|
Hello,
I was able to run SendMessage() without any issues however i am now trying the rest of your code and i cant get CreateAttachment to work.
I get the following errors
Error 1 The name 'intAttachmentsCount' does not exist in the current context
Error 2 The type or namespace name 'MessageBDO' could not be found (are you missing a using directive or an assembly reference?)
Error 3 The name 'p_signal' does not exist in the current context
Error 4 The name 'intIndex' does not exist in the current context
public ItemIdType CreateAttachment(string name, string FilePath, ItemIdType p_signalId)
{
ExchangeServiceBinding esb = new ExchangeServiceBinding();
esb.Credentials = new NetworkCredential("gpsmap", "0vSxnB2vITndpP5fCChr", "firecomm");
esb.Url = "https://hoexchange1/ews/exchange.asmx";
FileAttachmentType fileAttachment = null;
//Create add attachment request.
CreateAttachmentType attachementRequest = new CreateAttachmentType();
attachementRequest.ParentItemId = p_signalId;
attachementRequest.Attachments = new AttachmentType[intAttachmentsCount];
fileAttachment = new FileAttachmentType();
MessageBDO.AttachmentsDTRow drowAttachment = (MessageBDO.AttachmentsDTRow)p_signal.AttachmentsDT.Rows[intIndex];
fileAttachment.Name = name;
fileAttachment.ContentType = "text/plain";
fileAttachment.Content = System.IO.File.ReadAllBytes(FilePath);
attachementRequest.Attachments[intIndex] = fileAttachment;
ItemIdType attachmentItemId = new ItemIdType();
CreateAttachmentResponseType response = (CreateAttachmentResponseType) esb.CreateAttachment(attachementRequest);
if (response.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Success)
{
AttachmentIdType attachmentId = ((AttachmentInfoResponseMessageType)
response.ResponseMessages.Items[0]).Attachments[0].AttachmentId;
attachmentItemId.ChangeKey = attachmentId.RootItemChangeKey.ToString();
attachmentItemId.Id = attachmentId.RootItemId.ToString();
}
return attachmentItemId;
}
Would it possible for you to provide the source files?
Thank you
|
|
|
|

|
Hi,
I am new to C# coding. I am working on getting information(mailbox details) of Exchange Server 2007 remotely. I am able to retrieve items and folders of mailbox through EWS.
To get below details:
1) List of mailboxes
2) Total mailbox size
3) Last log on time
I need to execute cmdlets. cmdlets can successfully executed with in the Exchange Server but i want to execute the cmdltes remotely as i am calling EWS API from my local. Can any one help me in doing this? I wanted to execute Exchange Server 2007 cmdlets remotely through c# code.
Thanks in advance,
Sireesha
|
|
|
|

|
Hello Brij ;
I am a great fan of codeproject. I want to appreciate you a lot for submitting such beautiful article. You know the article is the begining for me to start integration. Prior to your article I was in dilemma like from where to start and how to proceed etc.
I saw your article almost 4 or 5 months back and tested with a small page. It is working fine and I kept aside. I prepared the other required things and took the permission from my management to proceed for the integration part. Now the problem started. Actually I am trying to find out the solution from more than two months. My intention is to solve it by myself. Now, it is mandatory for your help.
I have added the web reference same as mentioned in your article and the total description of problem was explained in microsoft forums at the following link
http://social.msdn.microsoft.com/Forums/en-US/exchangesvrdevelopment/thread/5727da97-c4cd-4fae-922e-ca17b31b1c8b[^]
why to repeat the total thing, as there is a congested space for questions in codeproject.
I request you to send me the solution. As it is working fine in the development system and getting problem when it is published to Windows Server 2003. Yesterday I tried to solve this with Visual Studio 2008 but the problem remained same.
Regards
Gajender Singh Thakur
Im a Programmer
|
|
|
|

|
Iam triying connecting EWS for a long time and i not have success. The problem is in the line
CreateItemResponseType createItemResponse = esb.CreateItem(createEmailRequest);
i get the error
"An internal server error occurred. The operation failed."
i tried it, i search trougth internet and i don´t find solutions.
Thanks
|
|
|
|

|
Hi, i have two questions:
1) Can I put on any "From" email address such as me@yahoo.com as the sender?
2) How to setup the premission on the exchange server. I am getting "405 Method Not allowed" error at statement esb.CreateItem(emailToSave).
Thanks.
|
|
|
|

|
I am a vb programmer with no experience with Exchange Server. I get the impression that EWS is for ASP-based applications. I have tried to "Add a Web Reference to your project" and cannot find the "Add Web Reference" menu option on the Project menu. How can I expose the EWS object model in vb?
Thanks
|
|
|
|

|
Hi,
I have created a Dynamic Web project using Rational Application developer and have created a web client by providing the exchange2007 WSDL URL. This generated lots of files and "ExchangeServiceBindingStub.java" is one of them.
I am unable to follow the steps that you have mentioned in your article :
1. I dont have ExchangeServiceBinding class instead I have ExchangeServiceBindingStub.
2. Dont have anything called "credentials" in ExchangeServiceBindingStub.java
3. The definition of "FindItem" method in my case is -
public void findItem(javax.xml.soap.SOAPElement request, com.microsoft.schemas.ExchangeImpersonationType impersonation, com.microsoft.schemas.SerializedSecurityContextType s2SAuth, java.lang.String mailboxCulture, com.microsoft.schemas.holders.FindItemResponseTypeHolder findItemResult, com.microsoft.schemas.holders.ServerVersionInfoHolder serverVersion)
unlike the one that you are using which just takes one input parameter "request". Same is the case in all the other methods also.
I dont understand these differences and not sure how do I invoke the call to Exchange 2007 in this situation.
Would be thankful if you can throw some light on my concerns and suggest on how to move ahead.
thanks
Samta
|
|
|
|

|
I am in the process of creating a mail notifier for my exchange mailboxes. My goal is to have an admin account check the boxes then forward a notification to the mailboxes preferred external email address alerting them of secure mail.
I was looking at an IMAP solution and ran into the problem that only the mailbox owner can check mail.
Do you know if EWS allows for admin login?
I know I can do it through OWA but did not see anything in your article where a admin user could log into another users mailbox.
|
|
|
|

|
Hi,
Thanks for the great examples.
I can send to ian@xtra.com but not ian@xtra.co.nz
The exchange2007 server sends an undeliverable message
ian@xtra.co.nz
The format of the recipient's e-mail address isn't valid. A valid address looks like this: username@contoso.com. Microsoft Exchange will not try to redeliver this message for you. Please check the e-mail address and try sending the message again, or provide the following diagnostic text to your system administrator.
Any help appreciated.
Thanks
Ian
|
|
|
|

|
Hi,
Is there any API for Exchange Server 2003.Can we use the same for exchange server 2003?I want to know which emails are successfully delivered to the recipient mailbox,who can be on any domain.
Thanks
|
|
|
|

|
Hello. Thanks for a great article. I tried your code against an Exchange server on which I have admin access, and received the following error when I reach
// Call the CreateItem EWS method.
CreateItemResponseType response = esb.CreateItem(request);
WebException:
The request failed with the error message:
--
<html><head><title>Object moved</title></head><body>
Object moved to here.
</body></html>
Any ideas?
Thanks,
David
|
|
|
|

|
Hi there,
I have taken your code for the first example for send message and put it into a winform. It's giving me an error message, saying it doesnt contain a definition for ThrowOnError. I did some googling and didnt manage to find it anywhere.
Any help would be great
Thanks
Will
|
|
|
|

|
Hi,
In the example of sending emails with attachment using EWS, 3 steps have been specified.
1. Create a message item of MessageItem Type by calling Createmessage.
2. Create an attachment item and attach it to the message item, passed in to this method.
3. Send the message item, by calling the SendMessage method.
However in Step 1, the CretaeMessage method does not return the ItemID of the newly created mesage.
This itemID (p_Handle)is required in the step 2 as a parameter when we call the CreateAttachment method.
Can anyone please show me with an example, as how to recieve the returned ItemID in a variable when we create the request item and return it to the calling script.
Thanks in Advance,
-Azfar
|
|
|
|

|
Hi I have been trying to get this to work for ages.... All i get is Type 'ExchangeServiceBinding' is not defined.
*######## My Code #######################
Imports NewMail.Exchange
Imports System.Net
Imports System.Net.Security
Imports System.Security.Cryptography.X509Certificates
Imports System.Threading
Public Class Form1
Private Shared Sub PullNotification()
' Create the binding and set the credentials.
Dim esb As New ExchangeServiceBinding()
esb.Url = "http://10.0.0.101/EWS/Exchange.asmx"
esb.Credentials = New NetworkCredential("Username", "Password", "Domain")
' Create a new Subscribe request.
Dim subscribeRequest As New SubscribeType()
Dim pullSubscription As New PullSubscriptionRequestType()
' Identify the folders that are monitored for events.
Dim folders As BaseFolderIdType() = New BaseFolderIdType(0) {}
Dim folderId As New DistinguishedFolderIdType()
folderId.Id = DistinguishedFolderIdNameType.inbox
folders(0) = folderId
pullSubscription.FolderIds = folders
' Identify the events that are monitored for the subscription.
Dim eventTypes As NotificationEventTypeType() = New NotificationEventTypeType(0) {}
eventTypes(0) = NotificationEventTypeType.NewMailEvent
pullSubscription.EventTypes = eventTypes
' Define the timeout period for the subscription.
pullSubscription.Timeout = 10
subscribeRequest.Item = pullSubscription
' Send the Subscribe request and receive the Subscribe response.
Dim subscribeResponse As SubscribeResponseType = esb.Subscribe(subscribeRequest)
' Check the results.
If subscribeResponse.ResponseMessages.Items.Length > 0 AndAlso subscribeResponse.ResponseMessages.Items(0).ResponseClass = ResponseClassType.Success Then
Dim subscribeResponseMessage As SubscribeResponseMessageType = TryCast(subscribeResponse.ResponseMessages.Items(0), SubscribeResponseMessageType)
Console.WriteLine("Subscribed for Pull notifications: {0}", subscribeResponseMessage.SubscriptionId)
' Wait 30 seconds before receiving event notifications.
Thread.Sleep(30000)
' Create a new GetEvents request.
Dim getEventsRequest As New GetEventsType()
' Identify the subscription identifier and watermark for the subscription
' that will be polled for changes in the Exchange store.
getEventsRequest.SubscriptionId = subscribeResponseMessage.SubscriptionId
getEventsRequest.Watermark = subscribeResponseMessage.Watermark
' Send the GetEvents request and receive the GetEvents response.
Dim eventsResponse As GetEventsResponseType = esb.GetEvents(getEventsRequest)
' Check the results.
If eventsResponse.ResponseMessages.Items.Length > 0 AndAlso eventsResponse.ResponseMessages.Items(0).ResponseClass = ResponseClassType.Success Then
Dim eventsResponseMessage As GetEventsResponseMessageType = TryCast(eventsResponse.ResponseMessages.Items(0), GetEventsResponseMessageType)
For Each type As ItemsChoiceType In eventsResponseMessage.Notification.ItemsElementName
Console.WriteLine(type.ToString())
Next
End If
' Create an Unsubscribe request.
Dim unsubscribeRequest As New UnsubscribeType()
' Identify the subscription to unsubscribe from.
unsubscribeRequest.SubscriptionId = subscribeResponseMessage.SubscriptionId
' Send the Unsubscribe request and receive the Unsubscribe response.
Dim unsubscribeResponse As UnsubscribeResponseType = esb.Unsubscribe(unsubscribeRequest)
' Check the results
If unsubscribeResponse.ResponseMessages.Items.Length > 0 AndAlso unsubscribeResponse.ResponseMessages.Items(0).ResponseClass = ResponseClassType.Success Then
Console.WriteLine("Subscribtion {0} unsubscribed successfully", unsubscribeRequest.SubscriptionId)
End If
End If
End Sub
End Class
*######### End of My Code ############
I have a web Ref to https://Exchange01/EWS/Services.wsdl
Any help would be great
Thanks
Chris
|
|
|
|

|
Hi, Wat does Exchange 2007 webservice programming... with asp.net...
Wat the use and purpose..?
and also give some sample project Regarding this...!
Shall i install Microsoft Exchange server 2007 ? then wat shall i do.
Can u pls guide me...
how to add EWS webservice to my projec
ha
|
|
|
|

|
I had been using System.Net.Mail for sending emails before referencing these articles (which have been extremely helpful, thanks). I needed EWS for reading mail and I thought I might as well convert my old code to use it for sending as well. My old code uses MailMessage.AlternateViews to provide a plain text option for recipients that do not support HTML messages. I am not finding a way to do this with EWS as the MessageType object only account for a BodyType of BodyTypeType.HTML or BodyTypeType.Text. Any ideas on how to accomplish sending a Multipart/Alternative message?
|
|
|
|

|
Hallo Brij,
I want to use EWS in .NET 2.0 to develop an application.
The application will read some xml data and insert/update/delete calendar appointment in Exchange server for every user, so it will effect outlook calendar for every user. The application will resides in the server(windows 2007 platform) itself.
err to be honest i don't know where to start, i'm trying to install Microsoft Exchang Server 2007 SP1 SDK from http://www.microsoft.com/downloads/details.aspx?FamilyID=47720D33-FA5A-4AF4-A8EB-FA39695CBAD1&displaylang=en[^] in XP platform, and it can't install because it off outlook is exists, i wonder should i install it in the exchange server instead?
I't be very thankfull for your explanation
- nel(ace_teh@yahoo.com) -
modified on Friday, December 5, 2008 5:59 AM
|
|
|
|

|
I am trying to create a client. But i am getting following exception
What am i doing wrong????
..using the specified credentials for HTTPS
?? Starting SCP lookup for domainName='schakrax.com', root path=''
!! LDAP call failed with System.Runtime.InteropServices.COMException (0x8007054B
): The specified domain either does not exist or could not be contacted.
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_AdsObject()
at System.DirectoryServices.PropertyValueCollection.PopulateList()
at System.DirectoryServices.PropertyValueCollection..ctor(DirectoryEntry entr
y, String propertyName)
at System.DirectoryServices.PropertyCollection.get_Item(String propertyName)
at AutodiscoverSample.Autodiscover.GetScpUrlList(String domainName, String ld
apPath, Int32& maxHops) in C:\Program Files\Microsoft\Exchange Server 2007 SP1 S
DK\November 2007\Samples\Autodiscover\AutodiscoverSample\Autodisover.cs:line 175
-- No response returned from SCP URLs, trying default URLs:
+= 'https://schakrax.com/autodiscover/autodiscover.xml'
+= 'https://autodiscover.schakrax.com/autodiscover/autodiscover.xml'
=? Trying 'mitch@schakrax.com' at 'https://schakrax.com/autodiscover/autodiscove
r.xml'
-! Info: System.Net.WebException: The remote name could not be resolved: 'schakr
ax.com'
at System.Net.HttpWebRequest.GetRequestStream()
at AutodiscoverSample.Autodiscover.DiscoverTryUrl(String emailAddress, Networ
kCredential nc, String url, Boolean authoritative, Boolean allowSelfSignedCerts)
in C:\Program Files\Microsoft\Exchange Server 2007 SP1 SDK\November 2007\Sample
s\Autodiscover\AutodiscoverSample\Autodisover.cs:line 456
=? Trying 'mitch@schakrax.com' at 'https://autodiscover.schakrax.com/autodiscove
r/autodiscover.xml'
-! Info: System.Net.WebException: The underlying connection was closed: An unexp
ected error occurred on a send. ---> System.IO.IOException: Unable to read data
from the transport connection: An existing connection was forcibly closed by the
remote host. ---> System.Net.Sockets.SocketException: An existing connection wa
s forcibly closed by the remote host
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size,
SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 s
ize)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 s
ize)
at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 c
ount)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocol
Request asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToke
n message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, A
syncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byt
e[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyRes
ult)
at System.Net.TlsStream.CallProcessAuthentication(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, C
ontextCallback callback, Object state)
at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.ConnectStream.WriteHeaders(Boolean async)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetResponse()
at AutodiscoverSample.Autodiscover.DiscoverTryUrl(String emailAddress, Networ
kCredential nc, String url, Boolean authoritative, Boolean allowSelfSignedCerts)
in C:\Program Files\Microsoft\Exchange Server 2007 SP1 SDK\November 2007\Sample
s\Autodiscover\AutodiscoverSample\Autodisover.cs:line 465
?? Trying GET redirect URL on non-SSL URL 'http://autodiscover.schakrax.com/auto
discover/autodiscover.xml'
+= 'http://autodiscover.schakrax.com/autodiscover/autodiscover.xml' returns vali
d redirect url 'https://autodiscover-s.exchangelabs.com/autodiscover/autodiscove
r.xml'
=? Trying 'mitch@schakrax.com' at 'https://autodiscover-s.exchangelabs.com/autod
iscover/autodiscover.xml'
-! Info: System.Net.WebException: The remote server returned an error: (401) Una
uthorized.
at System.Net.HttpWebRequest.GetResponse()
at AutodiscoverSample.Autodiscover.DiscoverTryUrl(String emailAddress, Networ
kCredential nc, String url, Boolean authoritative, Boolean allowSelfSignedCerts)
in C:\Program Files\Microsoft\Exchange Server 2007 SP1 SDK\November 2007\Sample
s\Autodiscover\AutodiscoverSample\Autodisover.cs:line 465
Following is the code.
ExchangeServiceBinding esb = new ExchangeServiceBinding();
esb.RequestServerVersionValue = new RequestServerVersion();
esb.RequestServerVersionValue.Version = ExchangeVersionType.Exchange2007_SP1;
esb.Credentials = new NetworkCredential("mitch", "password", "schakrax.com");
esb.Url = @"https://bl2prd0101.exchangelabs.com/EWS/Exchange.asmx";
|
|
|
|

|
Dear,
Thank four your excellent article, but I would like to access Exchange from Silverlight (Framework 3.5)
I saw that the only way to it was asynchronously via:
...
ExchangeServicePortTypeClient exchange = new ExchangeServicePortTypeClient();
exchange.FindItemAsync(item);
exchange.FindItemCompleted += new EventHandler(client_FindItemCompleted);
...
But every time I run the program I have this error on the line "ExchangeServicePortTypeClient ...".
The given key was not present in the dictionary.
I have absolutely nothing found on the Web, someone can help me and/or give me an example?
Thank you in advance
Jacky
|
|
|
|

|
First, I could not reference ExchangeServiceBinding directly - I named my Web Reference ExchangeWeb, and I can reference it as ExchangeWeb.ExchangeServiceBinding esb = new ExchangeWeb.ExchangeServiceBinding();
However, it cannot fing NetworkCredentials in the next line.
I am using 2008, if that helps.
Thanks.
|
|
|
|

|
MessageType has an attribute called "Attachment", I can set it with file content. But CreateItem (SendOonly) doesn't work? Any hints on this? Thanks!
|
|
|
|

|
Hi,
Nice article. Do you know how to specify the email folder location when doing a findItem? I have a problem where there is a OU folder by the same name as my email address and my email folder is located in /users/utility addresses. Thanks.
|
|
|
|

|
First of all, nice article.. I thank you for your contribution...
I'm looking for an example for reading the inbox folder.
Could you help?
I thank you.
Stan
|
|
|
|

|
cannot get what this "this.ThrowOnError" is plz help
|
|
|
|

|
Thanks for sharing . i am also Working on EWS and its very helpful for all who want to learn EWS 2007.
Good Job !!! Keep it up !!!
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
This article is the first part of the series on EWS which explores Exchange Web Services
| Type | Article |
| Licence | CPOL |
| First Posted | 20 Aug 2008 |
| Views | 290,679 |
| Bookmarked | 85 times |
|
|