Send Outlook Attachments in UiPath Automation Example |Video upload date:  · Duration: PT2M53S  · Language: EN

Learn how to send Outlook attachments using UiPath activities with a short tutorial and practical tips for reliable email automation

Yes you can make Outlook do the heavy lifting, and yes UiPath will happily boss it around. This guide walks through a tidy UiPath workflow that sends emails with attachments using the Send Outlook Mail Message activity. Read on for step by step how to avoid the usual pitfalls and look like you planned this from the start.

What this workflow actually does

In plain terms the automation creates an attachments list, configures the Send Outlook Mail Message activity, and sends one or many emails. Outlook must be installed and a profile logged in for the activity to connect to your mailbox. If that sounds obvious you are smarter than most robots.

Quick setup steps

  • Create a new process in UiPath Studio and add a Sequence
  • Add the Send Outlook Mail Message activity from the Mail activities package
  • Build a List Of String or an array of file paths and assign it to the attachments argument
  • Wrap the activity in a Try Catch to capture file errors and messaging exceptions
  • Run a test and inspect the Output panel for exceptions

Configure the Send Outlook Mail Message activity

Drag the activity into your Sequence. Populate To with recipient addresses and set a clear Subject and Body. For attachments provide a List Of String or string array containing full file paths. UiPath uses VB style expressions in argument fields so keep that in mind.

Example attachment variables you can paste straight into UiPath

attachments = New List(Of String) From {"C:\Attachments\invoice.pdf", "C:\Attachments\report.xlsx"}

If you prefer to auto collect files from a folder use Directory.GetFiles combined with a filter. That keeps the workflow scalable and stops you from copying file names like a medieval scribe.

Dim folder As String = "C:\Attachments"
Dim extensions As String() = {".pdf", ".xlsx"}
Dim attachmentsList As List(Of String) = Directory.GetFiles(folder)
    .Where(Function(f) extensions.Contains(Path.GetExtension(f).ToLower()))
    .ToList()

Common errors and how to stop them

  • Outlook not running or no profile logged in will prevent the activity from connecting. Start Outlook and sign in first.
  • File not found exceptions happen when paths are wrong. Log the attachments list before you call the activity to see what is missing.
  • Permission or locking issues occur if a file is open. Close the file or copy it to a temp folder before attaching.

Use Try Catch like a responsible adult

Wrap Send Outlook Mail Message in a Try Catch activity. Catch System.IO.FileNotFoundException to log missing files and catch System.Exception for other messaging or COM exceptions. Log useful details so the humans on call at 3am know what to do.

Try
    ' Send Outlook Mail Message activity goes here
Catch ex As System.IO.FileNotFoundException
    Log Message with level Error and message "Attachment not found" plus ex.Message
Catch ex As System.Exception
    Log Message with level Error and message "Failed to send email" plus ex.Message
End Try

Scaling tips that actually help

Loop over recipients and reuse the attachments list if the same files apply. Build the attachment list programmatically when files are generated by other workflows. If you do not have Outlook on the robot machine use Send SMTP Mail Message instead, which is less magical and more predictable in unattended environments.

Final notes

This is a compact and reliable pattern for sending Outlook emails with attachments in UiPath. Keep your workflow tidy, validate file paths, and log everything that might make you look competent later. Now go automate something pleasingly tedious.

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.