Greetings of the day…
i had given a task where i should download the attachment from the gmail and rename that attachment with senders mail id/username and date. They had said me that i should get the mail id and date in separate variable
eg: use A variable to get the mail id and B variable to get date. C variable is defined where C=A concatenate B. now this C will be renaming the file.
This is the task i am given but to get the mail id/username i had assigned a variable as name and gave mail.sender.displayname and made to display the content in name. But while i am running i am getting error.
can any one help me how to resolve this or is there any other way to get the username and date in a variable to achieve this task.
Hi @soumi_soumiya
you have to follow the following Steps.
Read Mails Using get Imap Mail Messages Activity
-Then use For each to Iterate the Mails select the For each argument as Mail.Mail messages
-Get the Mail Id using The Item.from.Address It will give you the senders mail Id
Get the date in Another variable using Item.Headers(“Date”)
-save The Attachment Using save Attachment activity
-Then To rename the files Use Move file Activity provide the source path as Old Path And destination Path As your NewFolderPath+Your Both Variables
Thanks for your reply
it works but i have a doubt regarding whether this renames each attachment that is downloaded else it only rename the overall folder.
I had done with CType syntax now i should replace the attachment name with mail id and date. So i have 3 variable named as name which stores the username and mail id, other is the dmy which stores the date,time and the last in rename variable which stores the name of the attachment that is found in the mail. So now my issue is that i cannot concatenate the username and dmy because it has some special characters. How to over come this. As you said to use replace activity but i dont know how to scrap only the mail id/user name and only the date leaving the special char. i am attaching the mail id and dmy format that i get. Help me out to rectify it.