I want to store this line VRN: VH91428 Ordernumber: 0000400334 as title on each folder inside another folder called Attachment. The VRN number and OrderNumber will always be different from each mail.
For each folder title VRN: VH91428 Ordernumber: 0000400334 i also want to store the actual mail body so i can perfrom another action on it later ( will be a read and write action)
use Get Outlook MailMessage activity to read mails from outlook and specify folder path “rpa”. It will give you output as List of Mail Messages and say ‘mailMessage’.
Then use For Each loop activity to iterate that list of mail messages and specify object type as System.Net.Mail.MailMessage.
ForEach item in mailMessage
- String mailSubject = item.Subject.ToString
- use Create File activity to create file and pass below fields to it.
We are storing output of Get Outlook Mail Message activity in mailMessages and it is of type List<System.Net.Mail.Message>
And then we are using For Each loop to iterate that list of mail messages.
Storing subject of the mail in mailSubject variable and it is of type String.
To create file, we are using Create File activity and we have to pass two input arguments to this like Name and Path.
Here, folder1 and folder2 are string variables. We are splitting mail subject and storing into it and then passing into Path under Create File activity.
Ok it was just a typo. but its just storing one file inside attachment folder, also its not making a new folder inside attachment folder with the name of the subject from mail. It just reads the mail and then make one file and not for all those who are unread