Get Outlook Mail Message not working

outlook

#1

Hi, I am trying to read all the emails in Outlook, i am not able to get all the properties of the outlook mail message i.e. not able to get email body, subject etc.


Fetching sender's details
#2

hi @anuraglahoti

Please go through with this link:

hope this will help you.

Updated after @vasilisg prob

OutlookSample_v2.xaml (7.3 KB)

*if you have already configured your outlook on system then you can run it as it is.

if you have any doubt or issues then feel free to ask :slight_smile:

Regards…!!


Get outlook mail messages not working
How to send a mail through UIPath while using SMTP,Outlook and send exchange mail mesage?
#3

Thanks Akshay.

Had a follow up question, UI path connects with my default folder.

But if I want to download email for another shared email mailbox, which gets opened up as additional mailbox in my outlook, I am getting an error. What would be best way to download the emails from the additional mailbox folder within my outlook


#4

Hi @aksh1yadav while trying your Sample I was able to get the Subject but the Body is Empty (I am using Outlook 2013), Also when trying to get the Sender I am getting a null exception. Any suggestion? Thank you


#5

hey @anuraglahoti

First of sorry for the late reply.
Didn’t noticed this. My bad :frowning:

To use another outlook email box you can pass the mail account in properties. only mention mail account name like email id when you have configured more then 1 account in outlook.

first configure the second account as well if you wants to use with outlook mail activities.

Note- If you wants to use other mail accounts like gmail etc then you can use other activities like IMAP and similarly like SMTP and POP3 according to your usage.

for gmail use IMAP activites.

Let me know the feedback on this. :slight_smile:

Regards…!!


#6

hey @vasilisg

Please check this sample workflow again. i have updated regarding that sender error.

and try to change the getoutlook mail properties Top to 5 and let me know still you are not getting the mail body?

Regards…!!


#7

Thank you for your help,

the body is still empty and the same exception occures, for either 1 or 5 mails. Can it be a security issue? My company is really strict about security, so maybe internally the way the mailBody is aquired is not safe and hence my company does’n allow it, but if this holds why am I able to get the subject?

Thank you!


#8

@vasilisg ut for me it’s working and updated .xaml not getting an error as well. On my system it is working well even I’m using my company outlook.

Regards…!!


#9

Maybe they don’t have default text body (guessing)…
You can check alternateViews and see if you can get one of them.


#10

Hi @vasilisg,

We are also facing same issue as like you.
So, have you get any solution ,if yes can you please give me .xaml file or solution.

Thanks,
Sandy


Move outlook mail message - The specified folder does not exist
#11

thanks, I tried to run the process, yet, it throw an exception saying that “specified folder does not exist”. may I know if I should first configured in outlook account, so that UIPath can read my Outlook account?? If configuration is required, may I know how to configure it in UIPath?? thanks~


#12

You have already setup Two outlook account on your system?

Regards…!!


#13

I can “get outlook mail” at the moment, but for “send outlook mail”, it throws to exception, saying that
"Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))"

may I know if I it is blocked by firewall?? and must be solved by company’s security team? any way from UIPath can help to solve this issue? thanks~


I receive /send the outlook mail and i need to store in data table
#14

Yes michal try to open your outlook and then try to run it will work :slight_smile:

Regards…!!
Aksh


#15

thanks, I have tried to close and re-open Outlook, but same exception box pop up…


#16

yes to make it work just remain open outlook for now. will soon get back to you :slight_smile:

Regards…!!
Aksh


#17

Hi All

I am getting below exception

Exception from HRESULT: 0x80004004 (E_ABORT)) while sending the mail using outlook send activity.

Any pointers ???

Please let me know


#18

Hey @Todd

According to a few of the Microsoft sites (e.g. https://social.msdn.microsoft.com/Forums/en-US/80c66a08-66ee-4ab6-b629-6b1e70143eb0/operation-aborted-exception-from-hresult-0x80004004-eabort-outlook-appointment?forum=outlookdev ) this is due to ‘object model guard’. A security feature to prevent automated programs from doing stuff like auto-emailing out viruses and stuff from the background.

Not sure… but if Outlook is installed and it is not open while running workflow then this might be a problem


#19

I face the same issue, and does not matter if the Outlook client is running or not. I am able to retrieve a message using the Outlook activity, I get a message collection of 1 item and then iterating through the collection, I can read the subject line with no issue (writing out to the log - in this case “Hillary + Robot”) - however as soon as I attempt to read the From property, I get an error message. In addition to reading the subject, the finally block moves the message to a different folder, so I know that the Mail item is properly instantiated - but something (presumably the object model guard) is blocking access to the From property.

System.Runtime.InteropServices.COMException (0x80004004): Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))
at Microsoft.Office.Interop.Outlook._MailItem.get_HTMLBody()
at UiPath.Mail.Outlook.Activities.Outlook.CreateMailMessageFromOutlookMailItem(MailItem mi, Boolean saveattachments, String folderpath)
System.Runtime.InteropServices.COMException (0x80004004): Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))
at Microsoft.Office.Interop.Outlook._MailItem.get_Body()
at UiPath.Mail.Outlook.Activities.Outlook.CreateMailMessageFromOutlookMailItem(MailItem mi, Boolean saveattachments, String folderpath)
> Retrieved 1
> Subject: Hillary + Robotics
Error handling email: System.NullReferenceException: Object reference not set to an instance of an object.
at lambda_method(Closure , ActivityContext )
at Microsoft.VisualBasic.Activities.VisualBasicValue1.Execute(CodeActivityContext context) at System.Activities.CodeActivity1.InternalExecuteInResolutionContext(CodeActivityContext context)
at System.Activities.Runtime.ActivityExecutor.ExecuteInResolutionContext[T](ActivityInstance parentInstance, Activity1 expressionActivity) at System.Activities.InArgument1.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance activityInstance, ActivityExecutor executor)
at System.Activities.RuntimeArgument.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance targetActivityInstance, ActivityExecutor executor, Object argumentValueOverride, Location resultLocation, Boolean skipFastPath)
at System.Activities.ActivityInstance.InternalTryPopulateArgumentValueOrScheduleExpression(RuntimeArgument argument, Int32 nextArgumentIndex, ActivityExecutor executor, IDictionary2 argumentValueOverrides, Location resultLocation, Boolean isDynamicUpdate) at System.Activities.ActivityInstance.ResolveArguments(ActivityExecutor executor, IDictionary2 argumentValueOverrides, Location resultLocation, Int32 startIndex)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
> DEMO execution ended in: 00:00:01

Initially, the IT team identified that my Antivirus was listed as invalid, and resolved that issue - however the problem persists.

Is there a profile or client setting which can solve this problem? Has anyone who has faced this problem been able to resolve it?

When I tried to run the OutlookSample_V2 I got the same warning (whether Outlook was open or not):

System.Runtime.InteropServices.COMException (0x80004004): Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))
at Microsoft.Office.Interop.Outlook._MailItem.get_HTMLBody()
at UiPath.Mail.Outlook.Activities.Outlook.CreateMailMessageFromOutlookMailItem(MailItem mi, Boolean saveattachments, String folderpath)
System.Runtime.InteropServices.COMException (0x80004004): Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))
at Microsoft.Office.Interop.Outlook._MailItem.get_Body()
at UiPath.Mail.Outlook.Activities.Outlook.CreateMailMessageFromOutlookMailItem(MailItem mi, Boolean saveattachments, String folderpath)
Outlook top 1st mail messages subjects==============================
RE: Approval required: Multiple orders for Sathish Srinivasalu

Write line : Object reference not set to an instance of an object.
DEMO execution ended in: 00:00:01


#20

Hi I had the same issue.

I had this to begin with, which gave me the “COMException” error:

StringTopLevelFolder: “\Inbox\Robot”

StringNextLevelFolder: “\Inbox\Robot\Archive”

I changed my StringNextLevelFolder path to “\Robot\Archive”

It somehow did the trick.