Not able to Send email when using Office365 Scope

Hello everyone, my name is Jorge.

I’ve been using the Office 365 Scope (1.5.0) and the Send Email activity since December for sending emails in Unattended mode. It worked perfectly until this Sunday, when the security team of the client executed some updates. I searched in every forum topic, tried updating my Office 365 package version, followed all Microsoft and UiPath guides for setting up Azure applications, and tried all the four authentication methods without success.

I created my application again, and gave admin permissions to all API permissions, but it’s still not working.

The security team reset the updates, but it does not work either.

If I leave the Office 365 Scope without any activity inside, it does not fail. Whenever I include the Send Email activity, it gives me the following error. I tried opening a support ticket, but the UiPath form is broken… If someone could please help me, it would be much appreciated. The process is really critical and we have been down for three days.

20.10.2+Branch.master.Sha.cf481ddc1ae94ab83e743f85d96fbfeca8fc705c

Source: Send Mail

Message: Code: generalException
Message: An error occurred sending the request.

Exception Type: Microsoft.Graph.ServiceException

RemoteException wrapping Microsoft.Graph.ServiceException: Code: generalException
Message: An error occurred sending the request.
β€”> RemoteException wrapping System.Security.Cryptography.CryptographicException: Clave no vΓ‘lida para utilizar en el estado especificado.

at System.Security.Cryptography.ProtectedData.Unprotect(Byte encryptedData, Byte optionalEntropy, DataProtectionScope scope)
at UiPath.MicrosoftOffice365.Services.EncryptedStorageService.Get()
at UiPath.MicrosoftOffice365.Helpers.Office365LogonTokenCacheHelper.BeforeAccessNotification(TokenCacheNotificationArgs args)
at Microsoft.Identity.Client.TokenCache.d__105.MoveNext()
β€” End of stack trace from previous location where exception was thrown β€”
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Identity.Client.Cache.CacheSessionManager.d__13.MoveNext()
β€” End of stack trace from previous location where exception was thrown β€”
at Microsoft.Identity.Client.Cache.CacheSessionManager.d__13.MoveNext()
β€” End of stack trace from previous location where exception was thrown β€”
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Identity.Client.Cache.CacheSessionManager.d__12.MoveNext()
β€” End of stack trace from previous location where exception was thrown β€”
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Identity.Client.ClientApplicationBase.d__14.MoveNext()
β€” End of stack trace from previous location where exception was thrown β€”
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.MicrosoftOffice365.Office365LogonService.d__5.MoveNext()
β€” End of stack trace from previous location where exception was thrown β€”
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.MicrosoftOffice365.GraphClientServiceFactory.d__9.MoveNext()
β€” End of stack trace from previous location where exception was thrown β€”
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.MicrosoftOffice365.GraphClientServiceFactory.<>c__DisplayClass8_0.<b__0>d.MoveNext()
β€” End of stack trace from previous location where exception was thrown β€”
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Graph.AuthenticationHandler.d__16.MoveNext()
β€” End of stack trace from previous location where exception was thrown β€”
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Net.Http.HttpClient.d__58.MoveNext()
β€” End of stack trace from previous location where exception was thrown β€”
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Graph.HttpProvider.d__19.MoveNext()
β€” End of inner exception stack trace β€”
at Microsoft.Graph.HttpProvider.d__19.MoveNext()
β€” End of stack trace from previous location where exception was thrown β€”
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Graph.HttpProvider.d__18.MoveNext()
β€” End of stack trace from previous location where exception was thrown β€”
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Graph.BaseRequest.d__38.MoveNext()
β€” End of stack trace from previous location where exception was thrown β€”
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Graph.BaseRequest.d__34`1.MoveNext()
β€” End of stack trace from previous location where exception was thrown β€”
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.MicrosoftOffice365.Activities.Extensions.OutlookExtensions.d__13.MoveNext()
β€” End of stack trace from previous location where exception was thrown β€”
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.MicrosoftOffice365.Activities.Extensions.OutlookExtensions.d__12.MoveNext()
β€” End of stack trace from previous location where exception was thrown β€”
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.MicrosoftOffice365.Activities.Mail.SendMail.d__46.MoveNext()
β€” End of stack trace from previous location where exception was thrown β€”
at UiPath.Shared.Activities.AsyncTaskCodeActivityImplementation.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at UiPath.Shared.Activities.AsyncTaskCodeActivity.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)

1 Like

Hi @rpa.hr.01 did you find the work around for exception stated?
I am too facing the same issue. Please help out.

Hello Pavitra,

I didn’t found the solution… Currently I’m still trying to figure out how to solve it. If you post a new ticket, please, comment what the outcome is.

Regards,