How to download attachments from mail in uipath
To download attachments from an email in UiPath, you can use the Get Attachment
activity. Here's a step-by-step guide:
Prerequisites:
- You have a UiPath robot with the
Mail
activity installed. - You have an email with attachments that you want to download.
Steps:
- Get the email: Use the
Get Mail
activity to retrieve the email with attachments. You can filter the emails by subject, sender, recipient, or other criteria. - Get the attachment: Use the
Get Attachment
activity to retrieve the attachment from the email. You can specify the attachment name, type, or index (if there are multiple attachments). - Save the attachment: Use the
Save File
activity to save the attachment to a file on your system.
Here's an example of how you can use these activities:
Get Mail
Get Mail
- Mail Server: <your mail server>
- Mail Box: <your mail box>
- Search Criteria: Subject = "Test Email"
Get Attachment
Get Attachment
- Mail: <output from Get Mail>
- Attachment Name: <attachment name>
- Attachment Type: <attachment type (e.g., pdf, docx)>
Save File
Save File
- File Path: <path to save the attachment>
- File Name: <attachment name>
- File Type: <attachment type>
Tips and Variations:
- You can use the
Get Attachment
activity multiple times to download multiple attachments from the same email. - You can use the
Get Attachment
activity with a loop to download attachments from multiple emails. - You can use the
Save File
activity with a variable to save the attachment to a dynamic file path. - You can use the
Get Attachment
activity with aTry-Catch
block to handle errors when downloading attachments.
By following these steps, you should be able to download attachments from an email using UiPath.