Flag email as "High Priority" in Send outlook mail

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.

Have you initialized the mail message variable?

New MailMessage()

circled in red below

1 Like

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:

1 Like

This is not working for me.

Yes, i have done that. Still its not working

1 Like

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

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

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

  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

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

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

1 Like

High Importance flag in outlook

Check this!!