Error when trying to send Outlook email

When trying to send email:

21.10.5+Branch.support-v21.10.Sha.369f46199a0fa6287d86ab2534b6896019db01bc

Property accessor ‘Account’ on object ‘UiPath.Mail.Activities.Business.OutlookApplicationCard’ threw the following exception:‘Unable to cast COM object of type ‘Microsoft.Office.Interop.Outlook.ApplicationClass’ to interface type ‘Microsoft.Office.Interop.Outlook._Application’. This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{00063001-0000-0000-C000-000000000046}’ failed due to the following error: Interface not registered (Exception from HRESULT: 0x80040155).’

RemoteException wrapping System.Reflection.TargetInvocationException: Property accessor ‘Account’ on object ‘UiPath.Mail.Activities.Business.OutlookApplicationCard’ threw the following exception:‘Unable to cast COM object of type ‘Microsoft.Office.Interop.Outlook.ApplicationClass’ to interface type ‘Microsoft.Office.Interop.Outlook._Application’. This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{00063001-0000-0000-C000-000000000046}’ failed due to the following error: Interface not registered (Exception from HRESULT: 0x80040155).’ —> RemoteException wrapping System.InvalidCastException: Unable to cast COM object of type ‘Microsoft.Office.Interop.Outlook.ApplicationClass’ to interface type ‘Microsoft.Office.Interop.Outlook._Application’. This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{00063001-0000-0000-C000-000000000046}’ failed due to the following error: Interface not registered (Exception from HRESULT: 0x80040155).
at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
at Microsoft.Office.Interop.Outlook.ApplicationClass.get_Version()
at UiPath.Mail.OutlookAPI.InitOutlook()
at UiPath.Mail.Outlook.OutlookAccountWithStoreDetectionService.GetSelectedStoreDisplayName()
at UiPath.Mail.Activities.Business.OutlookApplicationCard.GetAccount()
at UiPath.Mail.Activities.Business.OutlookApplicationCard.get_Account()
— End of inner exception stack trace —
at System.ComponentModel.ReflectPropertyDescriptor.GetValue(Object component)
at System.Activities.Activity.ReflectedInformation…ctor(Activity activity, ReflectedType reflectType)
at System.Activities.NativeActivity.CacheMetadata(NativeActivityMetadata metadata)
at UiPath.Shared.Activities.AsyncTaskNativeActivity.CacheMetadata(NativeActivityMetadata metadata)
at System.Activities.NativeActivity.OnInternalCacheMetadata(Boolean createEmptyBindings)
at System.Activities.Activity.InternalCacheMetadata(Boolean createEmptyBindings, IList1& validationErrors) at System.Activities.ActivityUtilities.ProcessActivity(ChildActivity childActivity, ChildActivity& nextActivity, Stack1& activitiesRemaining, ActivityCallStack parentChain, IList1& validationErrors, ProcessActivityTreeOptions options, ProcessActivityCallback callback) at System.Activities.ActivityUtilities.ProcessActivityTreeCore(ChildActivity currentActivity, ActivityCallStack parentChain, ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList1& validationErrors)
at System.Activities.ActivityUtilities.CacheRootMetadata(Activity activity, LocationReferenceEnvironment hostEnvironment, ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList`1& validationErrors)
at System.Activities.Hosting.WorkflowInstance.ValidateWorkflow(WorkflowInstanceExtensionManager extensionManager)
at System.Activities.Hosting.WorkflowInstance.RegisterExtensionManager(WorkflowInstanceExtensionManager extensionManager)
at System.Activities.WorkflowApplication.EnsureInitialized()
at System.Activities.WorkflowApplication.Enqueue(InstanceOperation operation, Boolean push)
at System.Activities.WorkflowApplication.SimpleOperationAsyncResult.Run(TimeSpan timeout)
at System.Activities.WorkflowApplication.BeginRun(AsyncCallback callback, Object state)
at UiPath.Executor.RobotRunner.d__93.MoveNext()

@mrrobin

Welcome to our UiPath community.

Is Outlook application installed in that machine ? And also the account you are using here is configured in Outlook application ?

Hi Lakshman,

Yes, outlook is the email service I use on a daily basis for work on this computer. Within UIStudio, the options that show are “Use desktop outlook app” or “use outlook 365”.

One difference I found is that when i try to use the outlook, for the “Account” it shows as “default email account” in the drop down, and i cannot select anything, however a peer was able to select their email address from the drop down. thinking this may be the issue, but unsure how to resolve.

@mrrobin

If possible can you please share screenshot of it.

You Could try updating your Outlook app as sometimes, certain activities throws exceptions while working with older versions.

One another reason for this exception could be that, the account you are accessing for your outlook activity is not registered with your Microsoft office account that’s why you are seeing “default email account” in drop down and not able to select anything else.

Happy Automation

@mrrobin

Is Outlook application configured properly in your system ?

Not sure, how could I check this?

@mrrobin

Open the Outlook application in your machine and see. If possible please share screenshot of it.

Method to fix -
Method 1: Make sure that you are connected to the Internet.
Method 2: Make sure that your Outlook email account settings are correct.
Method 3: Delete suspicious email messages from your mailbox.

Regards,
Rachel Gomez