Send Outlook Mail Message Exception

Hi All,

I have encountered the following exception when Robot tries to send out an email.

RemoteException wrapping System.IO.DirectoryNotFoundException: The operation failed.
at UiPath.Mail.Activities.SendMailActivity.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 robot immediately throw this exception when it reach the activity ‘Send Outlook Mail Message’.

As soon as I launch Outlook application before the Robot starts process, it able to send out the email successfully. However, when I close the application and re-run the process, it throws the above exception immediately. The robot was able to send out email successfully all the while without having the Outlook application open until today this exception occurred.

The documentation itself mention it not necessary to have the Outlook application open but it doesn’t seems so.

FYI, the current version of UiPath.Mail.Activities is 1.10.5, as for my Studio version is 2020.10.6.

Does anyone has any ideas or solution on this?

Thanks,

Regards,
Gwen.

@Gwen

Outlook application should be open and running while executing Outlook activities.

Hi @Gwen
I don’t know if that will work. But according to the Microsoft documentation (DirectoryNotFoundException Class (System.IO) | Microsoft Learn) it should be possible to determine which directory was not found.
Try catching the error with Try-Catch activity and then log exception.message for the System.IO.DirectoryNotFoundException.

Best regards,
Mike