Is there any way to get an entire Mail message without using for each loop

Implementation with RE-Framework.

I have a sceanario where I want to read outlook mail message including the attachment in mail.
I am using get outlook mail actiVity for this. this i am doing in get transactiondata workflow. My output is mail message list named my-mails.

I am passing the values of subject and mail body to the process workflow using
my-mail(in_TransactionNumber).subject
However I am not able to save the attachment in the process workflow as save attachment requires
mail message as input.

Can someone please , how can I pass the entire Mail message from get transactiondata to the process workflow ???

1 Like

@PrankurJoshi , can you share your inputs on this

Can you try assigning TransactionItem as

My-mails(in_transactionnumber)

I think this should send the whole message.

And make sure that your TransactionItem should be of type System.Net.Mail.MailMessage

If you have a workflow please share I will try to make it run

Thanks,
Prankur

Thanks for the inputs @PrankurJoshi
I will try this approach. Will update how it goes with suggested steps as you mentioned.

Hi @PrankurJoshi,
Yes using mail message as a transaction item helped. Thanks for your inputs.

2 Likes

Hi,
I’m trying to develop a process, where i will read outlook mails and once the transaction is complete, I will move that mail to another folder.
Here my Question is -

I want to read the mails in an iterative manner say 25. So, if i read the first 25 mails (in get transaction data) and complete processing them, i have to take next set of mails. But don’t know to implement the logic in get transaction data without ending up in End Process state after 25th transaction.

would love to hear if any tricks can be applied.
Thanks in advance :slight_smile:

Maybe you can try by reading all the mails. And make chunks of 25 mails from the total count. This 1 chunk of 25 mail will act as your one transaction?

1 Like

Thanks for giving me your time:blush: @rinki . But i want to reprocess the same mail if any exception occurs during the run.

And i found the way of getting 1 mail to process flow but using a temporary variable mailcount and reassign to 0 in “success” trigger when mailcount = transactiondata.count.

So i’ll read mails if transactionNumber = 1 or mailcount = 0.And clear the list before reading.

hi @rinki
I am new to uipath, i am trying to develop same workflow where i read all the mails in init state with a particular subject and then i will get each mail from the collection in process state through Transaction state.
For each mail item i need to download and process the attachment, could you please help me with how do i do it?

Hi @Aishwarya_Thakur ,

I have tried implemented using RE-framework and it worked.
Your Init will have all mails read and will be list of mail messages say (My-mails).
Pass this list of mails to the Get-Transaction Workflow.
As what @PrankurJoshi mentioned, make sure that your TransactionItem should be of type System.Net.Mail.MailMessage and assign My-mails(in_transactionnumber) as transaction item.
My-mail will be a list of your mail message read in the Init workflow.
So now one mail message is passed to the Process workflow for further processing/actions to be taken as required.(using Save attachment activity).

Thank You @rinki, that helped:)

Can u share your workflow please?