Getting back to emails (from Queue)

Hello,
I have a question:
I need to read email from shared mailbox, then extract some data and add item to the queue with extracted data. That was my dispatcher.
In Performer, pull item from queue, process and … I need move the email (email = currently process queue item) from shared folder to another folder.
The only activities I know which can move emails required ‘email’ type of argument. I don’t have.
Is it anything else that I can extract from original email that can be used as input argument to activity (don’t know which at this moment) which will move specific email?

Any help more than welcome.

Hi @robert.ozog

seems to be an interesting question

U can export the data to queue the mail message, but it will stored as object in queue

I don’t find any way by which we can convert the object to System.Net.Mail.MailMessage type [ i am still checking…]

But another way u can try is , take the body of email and store in queue as queue item

while in performer while u need to move the mail, use get outlook to retrive a list of mail and then u can filter that mail by the mail body by using below linq query

mail_moved = mails.Where(Function(mail) mail.Body.ToString.Equals(mail_body)).ToList().ElementAt(0)

where mail_moved is a avariable of type MailMessage and mail_body is the data retrived from queue item. and then use the mail_moved to move the mail message to required folder

That logic u can try

Regards,
Nived N
Happy Automation

Hi Nived,
thank you very much for your question.
I’ll use similar solution, just instead of email body I’ll extract Message ID
mail.Headers(“MessageID”)

Thank you,
Robert O.
and Happy Automation

1 Like

Hi @robert.ozog

i am still trying to find out out whether there is a casting function from object to mailmessage

i will update u if i get it

Regards,
Nived N
Happy Automation

Data extracted from the email by using Regex on the email body.
Extracted data was added to a queue as strings within queue dictionary.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.