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.
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.
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.
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()
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
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.
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.