Save multiple attachments from multiple emails to local folder with date from outlook

Hi All,

I am trying to Save multiple attachments from multiple emails to local folder with date from outlook. Please help

Hi @Sudheer_Kumar_S !

First of all you have to know the date of the message:

Asssign
mailDate(String) = mailMessage.Headers(“Date”)

Then you use activity - Save Attachments
Then you use for ach activity as:

For each attachment in mailMessage.Attachments with typeArgument “System.Net.Mail.Attachment”

In body of for each you will have:

Assign
originalAttachmentName = Path.GetFileName(attachment.Name)

Assing
newAttachmentName = mailDate + “_” + originalAttachmentName

Move file
from: Path.Combine(path from activity saves attachment).ToString, originalAttachmentName

to: Path.Combine(path from activity saves attachment).ToString, newAttachmentName
(That will rename you attachment and add the date)

The activity save attachment cant save attachment with different name.

Thanks for your reply but it is not taking as
mailDate(String) = mailMessage.Headers(“Date”)

please provide example flow if possible thanks in adavance