activities
latest
false
UiPath logo, featuring letters U and I in white

Productivity Activities

Last updated Oct 21, 2025

Save Email Attachments

UiPath.Mail.Activities.Business.SaveMailAttachmentsX

Important: The new version of the Outlook application impacts this activity. For more details, check New Outlook impact on UiPath Outlook Desktop activities.

Saves the attachments of a mail message or invite to a specified folder on your computer. Should be used for the email currently selected in the Outlook desktop app, or in a For Each Email activity when iterating through Gmail or Outlook emails. This activity must be added inside a Use Outlook 365, Use Gmail, or Use Desktop Outlook App activity.

To learn how to use this activity, check the following resources:

Configuring the Activity

In the Body of the Activity
  • Email - Select the Plus button, and then, from the menu, select the email whose attachments to save. When the activity is inside a For Each Email activity, select CurrentMail to indicate the current mail in the iteration. When automating the Outlook desktop app, you can also select Selected Mail to use the message that is selected in Outlook when the project is executed. Alternatively, you can select Open in Advanced Editor and enter a VB expression.
  • Filter by file name - For example, you can filter by .xls. Select the Plus button, then select Text from the menu, and enter a filter to narrow down the types of attachments to save by file name. You can use the asterisk * wildcard character, which matches any number of characters.

    For example:

    • To only save PDF attachments, enter *.pdf in the Text Builder.
    • To save all Excel files regardless of extension, .xls, .xlsb, .xlsx, and so on, enter *.xls* as the filter.
    • To save multiple types of attachments, for example PDFs and Excel files, enter *.xls|*.pdf as the filter.
    Note: This field supports regular expressions. Therefore, escape characters are required when treating characters such as the dot . sign as strings.
  • Exclude Inline Attachments - If selected, inline attachments, that is, attachments embedded in the email body, are not saved.
  • Save to folder - Select the folder icon to browse and select the folder where to save the attachments. Alternatively, you can indicate a file by selecting an option from the Plus menu. If a file with the same name as an attachment already exists in the folder, a digit is appended to the attachment name. If no folder is selected, the attachments are saved to the project folder.
  • Overwrite existing - If selected, overwrites an existing file with the same name as the attachment.
Properties Panel

Common

  • DisplayName - The name displayed for the activity in the Designer panel.

Input

  • Check the options in the body of the activity.

Misc

  • Private - If selected, the values of variables and arguments are no longer logged at Verbose level.

Options

  • Check the options in the body of the activity.

Output

  • Attachments - List of attachments saved from the mail.

  • Configuring the Activity

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo
Trust and Security
© 2005-2025 UiPath. All rights reserved.