Accessing Exchange E-mails on Office 365

email
activities
p_qa
exchange

#1

Hi All,

we are currently undergoing an upgrade to Office 365 from the previous Office 2010. Until now I have been able to receive and send E-mails via the exchange by specifying the exchange server address, supplying the domain, Password and User.

As part of the upgrade we need to perform testing to ensure everything works as expected and part of that testing is that the robot will continue to access E-mails ok. We performed Pre-Migration tests and everything worked as expected, I was able to receive all e-mails in the Robots Inbox and then send a test E-mail. We then migrated that account and since migration I have been unable to receive any E-mails, however I can still send.

We have been provided with a new Server address, and the only other change is that in order to authenticate the user now needs to be Robot.One@uk.company.com whereas previously it was simply Robot.One. It seems to authenticate fine as If this is not specified it throws a specific unauthorised user Error. However, I am now get a Aggregated Exception, the crux of which seems to be that it doesnt recognise the E-mail format as being a correct format

System.AggregateException: One or more errors occurred. —> UiPath.Mail.ExchangeException: The specified string is not in the form required for an e-mail address. —> System.FormatException: The specified string is not in the form required for an e-mail address.

Being as the activity doesn’t ask explicitly for an E-mail address, I assume that it is constructing one based on the User ID? Could this be causing it to build incorrectly as we now have to specify the entire E-mail in order to authenticate?

Any Help would be much appreciated.
Thanks
Pete


#2

@ovi can you confirm on this one? my guess is there’s something it doesn’t like about the uk.company.com (i.e. two dots).


#3

In order to confirm, we’ll need Studio version and UiPath.Mail.Activities package version please.


#4

Hi @ovi

Unfortunately we’re a bit out of date as it stands whilst we get full infrastructure implemented, however, Studio version is 2016.2.6232
UIPath.Mail.Activities was 1.1.6277.16049, however I just updated to 1.1.6562.21018 and still have the issue.

Interestingly, it only seems to be when trying to use Get Exchange Mail Message. Using the same Properties on Send Exchange Mail Message works fine with no errors and The Sent E-mail is received.

Thanks


#5

Hi Pete,

My first thought was that you didn’t set right the Properties in the Exchange activity, but since it works with Send so it should with Get.

I’ll send this to be tested and get back to you when i have an answer. Thanks!


#6

Thanks Ovi,

I’ve attached a screenshot with my current properties set up. I’ve tried all exchange versions, I’ve tried with and without the Domain, and all manner of combinations within the options.
As you can see the user is set as Robot.Three@uk.*******.com Previously before the O365 migration this was just Robot.Three which if used now provides an authentication error.

Below is the exceptions that are thrown.

Main has thrown an exception
Message: One or more errors occurred.
Source: Get Exchange Mail Messages
Exception Type: AggregateException
System.AggregateException: One or more errors occurred. —> UiPath.Mail.ExchangeException: The specified string is not in the form required for an e-mail address. —> System.FormatException: The specified string is not in the form required for an e-mail address.
at System.Net.Mail.MailAddressParser.ParseAddress(String data, Boolean expectMultipleAddresses, Int32& index)
at System.Net.Mail.MailAddressParser.ParseAddress(String data)
at System.Net.Mail.MailAddress…ctor(String address, String displayName, Encoding displayNameEncoding)
at System.Net.Mail.MailAddress…ctor(String address, String displayName)
at UiPath.Mail.ExhangeMail.CreateMailMessageFromEmailMessage(EmailMessage mimemessage, Boolean saveattchements)
— End of inner exception stack trace —
at UiPath.Mail.ExhangeMail.CreateMailMessageFromEmailMessage(EmailMessage mimemessage, Boolean saveattchements)
at UiPath.Mail.Exchange.Activities.GetExchangeMailMessages.GetMessages(ExchangeService service, String fromFolder, String sharedMailbox, Int32 count, CancellationToken cancellationToken)
— End of inner exception stack trace —
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)
—> (Inner Exception #0) UiPath.Mail.ExchangeException: The specified string is not in the form required for an e-mail address. —> System.FormatException: The specified string is not in the form required for an e-mail address.
at System.Net.Mail.MailAddressParser.ParseAddress(String data, Boolean expectMultipleAddresses, Int32& index)
at System.Net.Mail.MailAddressParser.ParseAddress(String data)
at System.Net.Mail.MailAddress…ctor(String address, String displayName, Encoding displayNameEncoding)
at System.Net.Mail.MailAddress…ctor(String address, String displayName)
at UiPath.Mail.ExhangeMail.CreateMailMessageFromEmailMessage(EmailMessage mimemessage, Boolean saveattchements)
— End of inner exception stack trace —
at UiPath.Mail.ExhangeMail.CreateMailMessageFromEmailMessage(EmailMessage mimemessage, Boolean saveattchements)
at UiPath.Mail.Exchange.Activities.GetExchangeMailMessages.GetMessages(ExchangeService service, String fromFolder, String sharedMailbox, Int32 count, CancellationToken cancellationToken)<—
—> (Inner Exception #1) UiPath.Mail.ExchangeException: The specified string is not in the form required for an e-mail address. —> System.FormatException: The specified string is not in the form required for an e-mail address.
at System.Net.Mail.MailAddressParser.ParseAddress(String data, Boolean expectMultipleAddresses, Int32& index)
at System.Net.Mail.MailAddressParser.ParseAddress(String data)
at System.Net.Mail.MailAddress…ctor(String address, String displayName, Encoding displayNameEncoding)
at System.Net.Mail.MailAddress…ctor(String address, String displayName)
at UiPath.Mail.ExhangeMail.CreateMailMessageFromEmailMessage(EmailMessage mimemessage, Boolean saveattchements)
— End of inner exception stack trace —
at UiPath.Mail.ExhangeMail.CreateMailMessageFromEmailMessage(EmailMessage mimemessage, Boolean saveattchements)
at UiPath.Mail.Exchange.Activities.GetExchangeMailMessages.GetMessages(ExchangeService service, String fromFolder, String sharedMailbox, Int32 count, CancellationToken cancellationToken)<—


#7

Could you please try with user Robot.Three@uk.*******.com in EmailAutoDiscover field?


#8

Hi Ovi,

I also tried using the auto discover rather than the server directly, in this instance it throws the error “The Auto discover service couldn’t be located”

interesting, the actual e-mail address remains robot.three@*****.com it is just the authentication on the server where the uk. has been added. Regardless, I have tried both versions in the auto discover and it could not be located. Based on previous conversations with IT, I believe the auto discover was turned off whilst we are undergoing migration as it was causing issues between the on premise and cloud.

Thanks


#9

Hi @Pete.Darby,
What is the best mail activity to access office 365 mails?
Did your issue got resolved


#10

Hi Sreekanth,

Issue still persists, although I believe its due to the username format that the company has adopted rather than anything specific to O365, I’m guessing under normal circumstances there would be no issue. Unfortunately our outlook is also tightly locked down, so whilst using the GetOutlook Mail activity works to a degree, all I’m then able to extract from it is the E-mail Subject and nothing else.

I would simply build a test case for each of the activities and trail them all to see which suits your use case best.


#12

hi @ovi,
I am facing with get mail activity using exchange service , we are not able to fetch the older email than current date in get email activity , can you please help us how to fetch the emails older than current date .
please guide us , if we are missing any thing …

Regards
Raj kumar