Flag email as "High Priority" in Send outlook mail

email
outlook

#1

I need to use Send outlook mail and it should be flagged as High Priority. Is there any property that can be used to do that?
I can do it using outlook front end- i.e. Open outlook,paste mail contents,click on high priority on top right,send
But there are many mails to be processed, so need to find a backend solution.
It can be done with mailMessage.Priority= MailPriority.High
But when assigning it before the SendOutlook mai activity, it is giving Null object reference error.


High Importance flag in outlook
#2

Have you initialized the mail message variable?

New MailMessage()

circled in red below


#3

@akhi_s27
Thanks!!
I was doing the same thing-- it was giving error
The trick is to not include msgMailMessage variable in the Forward property.
And i attached the body as (in Assign) msgMailMessage.Body=“This will contain the mail content”
(in send outlook message)-- Body = msgMailMessage.Body
just to make sure that msgMailMessage gets assigned to Send outlook message activity.

Problem is still not resolved-- not able to see high priority in the mail received. :sob:


#4

This is not working for me.


#5

@akhi_s27
Yes, i have done that. Still its not working


#6

Yes… I see that’s not working.
@UiPath need help here.


#7

I had contacted Helpdesk for this issue. This is their reply

Hello,
Thanks for contacting UiPath,

As per the existing functionality in UiPath Outlook Automation there exists no way to parameterise the Priority of the email sent.

Alternatively, we can use the below techniques

  1. Use UI Automation to send email through Outlook.
    Please find below some useful links for UiPath recorders
    https://www.uipath.com/tutorials/recording
    https://www.uipath.com/tutorials/advanced-ui-automation

  2. Use Custom activities/code to trigger email from Outlook
    Refer the following link for more details -> https://www.uipath.com/kb-articles/how-to-create-a-custom-activity


#8

If you are using Invoke code activity this can be done. Use the below code.

Dim OutlookApp As Microsoft.Office.Interop.Outlook._Application
OutlookApp = New Microsoft.Office.Interop.Outlook.ApplicationClass
Dim mail As Microsoft.Office.Interop.Outlook.MailItem = DirectCast(OutlookApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem), Microsoft.Office.Interop.Outlook.MailItem)
mail.Subject = “Test Email”
mail.Body = “Test Email”
mail.To = “emailID”
mail.Importance = Microsoft.Office.Interop.Outlook.OlImportance.olImportanceHigh
mail.send()

You’ll have to import outlook interop namespace as well.
Let me know if it works.