Saving exchange email attachment

I use the activity get exchange mail messages and store them into a variable. How do I save an attachment from an email to a folder. The Save Attachments activity does not working.

Hey!

Filter the mail by subject or attachments…

After filtering use save attachments activity to download the attachments to particular folder

Regards,
NaNi

Hello @Emily_OHeron

What’s the error you are getting while using Save attachments?

if you get the messages, you need to loop through each message using for loop then you can use save attachments.

Thanks

Welcome @Emily_OHeron to the UiPath Community forums! :partying_face:

You are in the right place for help :slight_smile:

If you are using Exchange then you can use the “Save Attachments” activity (click here for the documentation). The trouble you might get is saving them dynamically so you don’t overwrite each file. I would suggest adding to your file name something like this:
"attachment "+now.tostring(“dd-MM-yyyy HH;mm;ss.fff”

You can add a filter to only get PDF files if you want.

Hopefully this helps :blush:

Cheers

Steve

1 Like

Hi, I had the same error and soved it like this:

Click on your Get Exchange Mail activity. Under properties > options make sure the “Get Attachments” is checked. Then, save the output in a variable.
Afterwards use a for each activity, to loop through all the retrieved mail message items and use the “Save Attachments” activity.

Hope this helps!