Get Exchange Mail problem

Hi Community,

I can’t get Get Exchange Mail Messages activity to work.

I try to configure it providing Email Auto Discover string in format “autodiscover.(…)/Autodiscover/Autodiscover.xml” - this adress returns account configuration data in outlook. And I provide domain user name or full email adress in activity “User” field.

In any case as a result the activity returns error. I run this activity for the mail account of currently logged user.

Main has thrown an exception

Source: Get Exchange Mail Messages

Message: The e-mail address is formed incorrectly.

Exception Type: ExchangeException

UiPath.Mail.ExchangeException: The e-mail address is formed incorrectly.
at UiPath.Mail.Exchange.Activities.ExchangeActivity`1.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

The other way I try is to provide server (server in format “https://(…)/EWS/Exchange.asmx”, domain, password and user (I run this while logged to AD as a user of this email address). In this case there is always a different error:

An error has occured

Source: Newtonsoft.Json

Message: ISerializable type ‘Microsoft.Exchange.WebServices.Data.ServiceRequestException’ does not have a valid constructor. To correctly implement ISerializable a constructor that takes SerializationInfo and StreamingContext parameters should be present. Path ‘’, line 1, position 295.

Exception Type: JsonSerializationException

Newtonsoft.Json.JsonSerializationException: ISerializable type ‘Microsoft.Exchange.WebServices.Data.ServiceRequestException’ does not have a valid constructor. To correctly implement ISerializable a constructor that takes SerializationInfo and StreamingContext parameters should be present. Path ‘’, line 1, position 295.
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateISerializable(JsonReader reader, JsonISerializableContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateISerializableItem(JToken token, Type type, JsonISerializableContract contract, JsonProperty member)
at Newtonsoft.Json.Serialization.JsonFormatterConverter.Convert(Object value, Type type)
at System.Runtime.Serialization.SerializationInfo.GetValue(String name, Type type)
at System.Exception…ctor(SerializationInfo info, StreamingContext context)
at Void .ctor(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)(Object )
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateISerializable(JsonReader reader, JsonISerializableContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at UiPath.Shared.JsonParser.DeserializeObject[T](String jsonValue)
at UiPath.Models.UiPathDuplexProxy.<>c__DisplayClass18_0.b__0()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()

In both cases i tried this with setting Exchange version to all the possibilities with the same result

Please help.

How about just not using the Autodiscover feature? Will it work?

Yes, I finally managed to make it working. As an autodiscovery parameter I was passing the string with full autodiscovery xml path. Changed it to actual email adress instead nd it worked. Thanks.

can u tell in detail pls, what to put in autodiscoverable field?
I tried outlook.office365.com and outlook.office365.com\ews\exchange.asmx

and have put other details as required.

When you use autodiscorver feature provide only the full actual email address in the email autodiscover field. Do not specify “Server”, and Logon Details in the activity.

The user that is running the process should have the access to this mailbox.