Why and how to solve the Send Email: Value cannot be null. (Parameter 'value') error in UiPath.Mail.Activities.1.24.0?
Issue Description:
While trying to use Send Mail activity from the UiPath.Mail.Activities.1.24.0 package in Studio and StudioX profiles, this error occurred Send Email: Value cannot be null. (Parameter 'value')
RemoteException wrapping System.ArgumentNullException: Value cannot be null. (Parameter 'value')
at System.ArgumentNullException.Throw(String paramName)
at System.ArgumentNullException.ThrowIfNull(Object argument,
String paramName)
at System.Net.Http.DelegatingHandler.set_InnerHandler(HttpMessageHandler value)
at UiPath.Shared.Authentication.Microsoft.Utilities.AuthenticationDelegatingHandler..ctor(Func`3 getToken,
HttpMessageHandler innerHandler)
at UiPath.Shared.Services.Graph.GraphClientServiceFactory.CreateWithDefaultDelegate(OAuthDataOptions model,
CancellationToken cancellationToken)
at UiPath.Mail.Exchange.GraphClient.ExchangeServiceFactory.CreateConnection(ExchangeConnection exchangeConnection,
CancellationToken cancellationToken)
at UiPath.Mail.Exchange.GraphClient.ExchangeMailProxy.EnsureGraphServiceCache(CancellationToken cancellationToken)
at UiPath.Mail.Exchange.GraphClient.ExchangeMailProxy.SendMail(SendMailRequest request)
at UiPath.Mail.Activities.Business.SendMailX.ExecuteAsync(AsyncCodeActivityContext context,
CancellationToken cancellationToken)
at UiPath.Shared.Activities.AsyncTaskCodeActivityImplementation.EndExecute(AsyncCodeActivityContext context,
IAsyncResult result)
at UiPath.Shared.Activities.AsyncTaskCodeActivity.EndExecute(AsyncCodeActivityContext context,
IAsyncResult result)
at UiPath.Mail.Activities.BaseMailAsyncActivity.EndExecute(AsyncCodeActivityContext context,
IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor,
BookmarkManager bookmarkManager)
Cause:
A specific value from the Use Outlook 365 scope is not transferred to the next activity Send Email. This bug was present only in the UiPath.Mail.Activities.1.24.0 package version.
Resolution:
Approach #1:
Downgrade the UiPath.Mail.Activities package from 1.24.0 to 1.23.11 and retry to send the email.
Approach #2:
Upgrade the UiPath.Mail.Activities package from 1.24.0 to >=1.24.1 and retry to send the email.