How to resolve when "Get Outlook Mail Messages" activity doesn't retrieve Mail Body and From address?
Issue Description: "Get Outlook Mail Messages" activity doesn't retrieve Mail Body and From address
- Try checking the Group Policies. Go to Checking Group Policies
- Try the powershell test to confirm it is not an UiPath issue
- Every time this issue has been seen, it has always come down to Group Policy settings. Either remove the group polices or consider using the 365 activities or one of the other Mail activity offerings.
Checking Group Policies:
- Open a command prompt as an administrator
- Run the command >gpresult /h %temp%/gpresults.html
- Open the file.
- Check the Download Group Policy Settings For Windows and Windows Server - a full list of Windows Group Policies
- Check to see if the following settings are enabled. If they are, they need to be disabled.
- Check that Get Outlook Mail Message is not retrieving mail body using MailMessage.Body
- Try with MailMessage.Headers("HTMLBody")
- Check with following PowerShell script to retrieve Mail Body :
Connecting Outlook with below command
$Outlook = New-Object -ComObject Outlook.Application
# Now getting all folders info in variable (Shows Email, Calendar, Tasks etc)
$OutlookFolders = $Outlook.Session.Folders.Item(1).Folders
#Now connecting Inbox mails
$OutlookInbox = $Outlook.session.GetDefaultFolder(6)
#Now reading latest mail
$latestmail=$OutlookInbox.items | select -last 1
#Now calling email content and getting email content as output in html
Following Registry changes have been found to work in some cases :