How to read Outlook email subjects in UiPath Studio example |Video upload date:  · Duration: PT6M25S  · Language: EN

Learn how to read Outlook email subjects in UiPath Studio using Read Outlook Mail Messages For Each and Subject extraction for automation workflows

Get your robot to read subjects without crying

If you need to pull Outlook message subjects in UiPath Studio and move on with life this guide shows a tidy, reliable way to do it. No mystical plugins, just UiPath Mail activities and a bit of common sense. Expect a few clicks in Package Manager and a tiny amount of grumbling when versions do not play nice.

Install the mail activities and choose a version

Open Manage Packages and search for UiPath.Mail.Activities. Install the version that matches your Studio build. If it complains about compatibility try a nearby version. This is not rocket science, just software archaeology.

Fetch messages with Read Outlook Mail Messages

  • Use Read Outlook Mail Messages and set MailFolder to the folder you want to scan.
  • Set Top to a small number when testing so you do not accidentally process years of spam.
  • Set Account or Mailbox if you have multiple mailboxes configured.
  • Use the Filter property to reduce noise when the inbox is large. Filtering now saves debugging later.

Store results in a variable

Assign the Output of Read Outlook Mail Messages to a variable named mailList of type IEnumerable(Of System.Net.Mail.MailMessage) or List(Of System.Net.Mail.MailMessage). That variable holds the messages and is what you loop over next.

Loop through messages and read the Subject

Use a For Each activity with TypeArgument set to System.Net.Mail.MailMessage. Inside the loop reference currentMail.Subject to get the subject text. That is the same property UiPath uses everywhere because Microsoft was feeling consistent that day.

Common cleanup and safety checks

  • Wrap parsing in a Try Catch when dealing with strange encodings or malformed headers.
  • Use Trim to remove leading or trailing whitespace from the Subject string.
  • Apply a Regex when you need to strip ticket tags or prefixes such as square bracket codes. A simple pattern like ^\[.*?\]\s* will remove a leading bracketed tag.

Log it or route it

Send the cleaned subject to a Log Message activity or an Assign for downstream logic. From there you can route subjects to queues, files, or decision branches. Routing to an Orchestrator queue works great when parallel processing is planned.

Troubleshooting and performance tips

  • If the mailbox has many messages use Top and Filter to fetch a small test batch before scaling up.
  • Check Account settings when emails are missing. The wrong mailbox will make your workflow stare at an empty abyss.
  • Validate on a handful of messages first. If subject extraction fails on edge cases add more robust Regex or extra Try Catch handling.

Follow these steps and you will consistently read Outlook subjects in UiPath Studio without drama. You will also have a neat variable of MailMessage objects to reuse for body parsing, attachments handling, or gentle machine led complaints about email volume.

I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!

This is a dedicated watch page for a single video.