How can I save attachment directly out of email with a new name (e.g. date of email)?


I want to save the attachment of emails in my computer folder with a new name (e.g. date of email).

I have already tried out the rename activity, but it did not work (for me).

How is the best way to do it?


Hi @aaydin ,

Rename file might work if you provide input as attachments(0).

Where attachments is the output of save attachment activity.

You can get mail received date using mailVariable.Date

Hi @aaydin

Give a try to this




Hope this helps.


Where do I put this information?


Check this

Is “attachments(0)” a new variable?

Sorry I did not get your point :frowning:

Hi @aaydin ,

attachment is output of Save attachment activity.


Hi @aaydin ,

Method suggested by @Suraj_B_Shetty is more efficient than mine as you can change the name before saving the attachment. You can try that method.

@Harshith_Adyanthaya @Suraj_B_Shetty
My idea is to save the attachment of email in that format:

e.g. “134705_John Mayer”

I saved datetime and sendername in variables


str_SenderName = mail.From.DisplayName.ToString

When I try to put bot variables as new name in Rename activity it does not work.

What was the input you provided for rename activity?
It should be output of save attachment activity (0).


New Name:

Thank you!

Does it throw error?

Now it worked. thank you

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.