How to get sender email adress from outlook

Hey guys,

I am doing a robot which is getting the sender email adress from x new and unread emails and save the adress into an excel sheet. The saving is working fine and is pretty simple.

The problem is getting the email adress.
Currently i receive the name only - like Surename, Forename (AB C DE) and i was trying to get the correct mail adress from the name but that is not working save… When Sureename, Forename.exists my contactbook gets broken.

Is there a way to get the sender email adress from a new mail?

Thanks for your help!

Greetings!

I am assuming you are reading emails using ‘Get Outlook Mail Messages’ activity.
This should give you a collection of MailMessage objects which you then iterate with a for loop.

The mailmessage object will give you access to all the attributes of the email.
Example:
For Each message in listOfMessages
Assign → sender = message.From.ToString
There is also message.Sender object. See which one gives you the correct email address you’re looking for.

I hope this helps.

1 Like

Thanks! This works for me ! :relaxed:

1 Like

Glad to help!
Happy automation!

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