How to get item.Headers.Item("In-Reply-To").ToString in get mail Microsoft 365

  1. how to get subject from get mail
  2. how to get headers item in reply to

image

Hi @sathish_Kumar6

for subject - use item.Subject

header items might not exist for all items . You can use item.Header.keys to check if it has any data

cheers

1 Like

Subject works
But headers throwing error

Hi @sathish_Kumar6

As I said all the emails might not have headers. SO first you need to do a count of keys to check if the header is present only then you can check for required keys.

item.Header.keys.count will give the count

Let me know why you want to use header data may be that might help to point you in right direction

cheers

thanks for the reply but it shows same error

Hi @sathish_Kumar6

My bad it is item.Headers.Keys.Count instead of Header

cheers

1 Like

I want to exrtract the sent date from sent items so i use item.Headers(“date”)
But it is not showing results so what to do in microsoft 365 get mails

okay checking

Hi @sathish_Kumar6

Please use item.LastModifiedDateTime which will give you the required date and time

cheers

Im assigning values to get mail so when i put item.LastModifiedDateTime it says compiling error

image

Hi @sathish_Kumar6

are you using office 365 get mail? because I see the mailmessage type is different. Can you check in the type argument of for loop and change the type argument appropriately to office365mailmessage

cheers

Sorry for the delay response and After changing Still no result

Hi @sathish_Kumar6

Please don’t use headers. use item.LastModifiedDateTime for the date that you need

cheers


i cant use it item or items.lastmodified its not working

Hi @sathish_Kumar6

Use item.LastModifiedDateTime.ToString() as you are trying to assign the value to string

cheers

sure will do but i have typed something but due to internet issue couldnt convey my whole message

Actually i need one help like im trying this automations for more than 15 days so could you please help me on this?

how to retrieve Microsoft 365 get mails like whether i have replied for that mails or not from sent items, so may i know how to do that?

Hi @sathish_Kumar6

good to know .Happy Automation. Please mark the solution so that it helps others

cheers

1 Like

Hi @sathish_Kumar6

So …you want to know if a message is replied or not… there is no direct way but you can try this… from get mails once you get your inbox …and getting the mail you can get the unique id of the mail and then use get mail from sent items and then match the id for this your in-reply-to in header will help to match.thats not straight but give it a try

Cheers

1 Like

Happy birthday @Anil_G

Actually the headers is not working…previously it was working in get imap but
item.headers.item(“In-reply-to”) is not working in either in o365 and exchange get mails

Hi @sathish_Kumar6

Thank you so much :slight_smile: … that will work only for sent items…so try that header in sent…first check what keys you are getting. Wven i will check it but as of now little away from laptop…will give you update as well

Cheers