Outlook mail from sender issues

I have had no problems before using get imap messages to get the sender’s email and display name.

However I have had to switch to get outlook messages.

When I send an email from a gmail account it works fine using

mail.From.Address.ToString()

or

mail.Sender.Address.ToString()

But when I send from an outlook mail, it works once and then throws me an

Write line: Object reference not set to an instance of an object.

But as mentioned it works when sent from gmail

@Mayur_Pande Please share screenshot. UiPath integrates Outlook and we need to use send Outlook message activity.