Office 365 WEB MAIL (Outlook) - HELP!

I have been scouring the forums and internet in general and I can’t seem to find a solution to this that doesn’t involve a 3rd party.

Issue Summary:
I’m using office 365 outlook webmail and I’m trying to get the received/sent dates pulled from the mail message. I can get the subject, body, To, fields all fine so everything appears to be set up correctly but I can’t seem to get any dates to work.

Have tried:

  1. item.Headers(“Date”) – Doesn’t work in webmail but does work in Outlook App on the machine. *I can’t use this though I need to use webmail
  2. Multiple variations of Headers(“BLAHBLAH”) ex. “createdDateTime”, “receivedDateTime”
  3. Tried splitting the body up to get some data but not reliable.
  4. Using Header “Key’s” but I might have done that wrong?

Need:
To know how to get the header information off of web emails. - I’m going crazy over here!

@Shannon
Welcome to the forum:
following:

give a try on
YourMailVar.Headers(“sentDateTime”).toString
YourMailVar.SentDateTime

check YourMailVar.Headers.AllKeys

Can share with us some screenshots related to the variables (variable panel) and your access implemenetation part. Thanks

1 Like

Hi Peter, Thanks for replying

I’ve tried the Headers(“sentDateTime”).tostring - The message box comes back blank or with…
<Multiple Assign: Can not assign ‘mail.headers(“sentDateTime”).ToString’ to ‘Outlook_Mail_ClosedDate’.>

I’ve also tried changing the Outlook_Mail_ClosedDate - To System.DateTime and DateTimeOffset and it throws an error
<Cannot assign from type ‘System.String’ to type ‘System.DateTime’.>

I Also tried doing the Headers.AllKeys but It tells me it has to be in an array and I tried to loop through the created array and essentially there were no items. I’ve since deleted all of that code.

It will only let me do one photo at a time for some reason…

but the typeargument property from for each activity has been set to
UiPath.MicrosoftOffice365.Models.Office365Message
right?

1 Like

It is set to “System.Net.Mail.MailMessage” … Let me try the one you just typed out… I’m going to be so mad but also so thankful if this is it…

we would recommend to do such analysis on immediate panel
set breakpoint
run debug - get paused
open immediate panel
check statements

grafik
this way of exploration is faster and more direct

Also check your statements and respect case sensitive var names

Mail (for each) vs. mail… from other screenshot

1 Like

You sir…are a LIFE SAVER!!! Thank you SO MUCH!!! You have no idea how much time I’ve wasted trying to figure this out knowing I must have done something stupid. - Seriously, thank you so much!

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