Attach a file to Email (outlook) based on daily naming convention


I am trying to attach a file to outlook email, but the file name changes every day based on the date the report run. Could anyone share what file name I should enter in the path?


Create a variable to generate the changing date part of the filename and then pass that value along with the static pieces of the path to the “Attachments” property of the activity you are using to send your mail message. If you provide more details on what the filename and the date format are I could offer more assistance.

1 Like


“C:\Users\chenr\Documents\Daily Download Export\2018\September\10032018.xlsx”

The date part is what I am trying to make it change everyday.

Thanks for your help.

1 Like

In the path get the current data with the format you require.
Like this:
“C:\Users\chenr\Documents\Daily Download Export”+Now.ToString(“yyyy”)+""+Date.Now.ToString(“MMMM”)+""+Now.ToString(“MMddyyyy”)+".xlsx"

This will even get folder 2018 and September with current ones

Hope it helps