Save mail in a folder having Sender ID and mail date as its folder name

email
outlook
studio
beginner

#1

I’m trying to save the mail message from Outlook but I want to save the messages in the folder having sender id and mail date as its name.
I created this solution:

MailMesage Saveto_folder.xaml (10.1 KB)

In the above solution, I have created a variable named folderlocation, which stores the path of the directory. Since I want a separate folder for each mail, I have given directory path as:

"C:\Users\rishi\Desktop\MailSavedbyBot\"+ SenderID + mailDate+"\"

Ater this, the variable is paased ro the path exist activity whcich checks if the path exists and if not then it the variable is passed to create folder activity. But when this variable is passed to create folder activity I’m getting this error message:

Please guide me and let me know where I’m going wrong.

Thank You.


#2

Hey @RishiVC1

Try this: MailMesage Saveto_folder.xaml (10.2 KB)


How to save mail message with different names inside the same folder
#3

Could you please explain changes you made and why? And where I was going wrong?

Thanks :slight_smile:


#4

Yes …

There are few things

  1. You were using “item.from.tostring” which is returning the contactname < mail_address> so sometimes it contains some characters in my case it was , So insted you can use either subject for shorter string in your case or item.from.address as well.

  2. The other thing is you are taking date string from header(“date”) which was returning string like 25/5/2017 so for your information Windows does not support “/” in file name so i have converted that string into datetime and then its format to dd-MM-yyyy.

Regards…!!
Aksh