How to get the sender's info i.e. 'From' Address of the mail in OUTLOOK

I am getting Null Reference Exception Please Help!!!

Can you attach your workflow?
There can be 2 problems: wrong mailfolder or you want read "read"messages.

yes i am trying to read already “read” messages
Does it not work for already read messages??


I have used all the possibilities but it is not working. It is showing the following Exception


Main.xaml (13.3 KB)

I have attached the file above

Use method:
item.sender.toString
Try to writeline with this method

BTW have you changed typeargument in for each to system.net.mailmessage?
For me works

I have changed the method but also it is not working!!!

See I have kept the following type argument … but the same exception occurs!!!
:frowning:

Follow my steps:

  1. Create get outlook mail messages
  2. Adjsut mailFolder name, account can be empty, uncheck “onlyUnreadMessages”,create variable for output
  3. Create for each loop and change TypeArgument to System.net.mailMessage
  4. Create WriteLine and put inside “item.Sender.ToString”

Run the workflow.

@lucky121 May be your not having mails for the filter condition u have set or u may have not assigned output variable to get mail messages activity. Check these two things once again.

I had declared output variable for mail activity and i also have mails in the specified filtered folder in my outlook. I have unchecked both ‘Mark as Read’ and ‘Only Unread Messages’.
I am getting exception only when i am trying to extract sender’s name .
For all other attributes like subject,Headers,date it is working fine.I am facing problem only in extraction of “from address”.
I had also tried the steps you have mentioned above but there is no change!.The same exception is occurring.

What should be mentioned in the ’ Filter ’ section in ‘Get Outlook mail messages’ Activity???

exception type :Mailkit.Net.Imap.ImapProtocolException error in uipath get imap mail message activities
error message : imap server disconnected
please reply any one