Get date from email:{subject, body, attachments}

@ppr @prasath17 @prasath_S @Yoichi @I.S @aksh1yadav @abdel @J0ska @GunashekharKotla @Ishmeet_Bindra

Here is sequence of steps i need to do :
1.I need to read emails
2.check the subject if there is
“Your date is: 22-26 March 21”
“Your date is: 15-19 Feb 2021”
"Your date is: 15-19 March 21
take the lastest date and get the date in format “dd/mm/yyy”
3.else in the subject if there is:
“next date is 5-7 working days.”
“next date is 12-14 working days.”
get the highest no of days
get the date from subject and get the date from all the
attachments(attachments can be email that has pdf or directly attached to
add the highest of days to latest date(subject , date from all the pdf)
finally return the get the date in format “dd/mm/yyyy”

Please help , or tag someone who can help

few errors that’s difficult to resolve :
how to retrieve the name of the attachment of email , attachment can be .msg .pdf .xls .xlsx format
retrieve the list of string as list of all the attachments of email ?

calculate the maximum/latest among three/four dates ?

solving this error after getting date from pdf
Assign: Conversion from type ‘Match’ to type ‘Integer’ is not valid.

convert date format(dd-MMM-yy) or (dd-MMM-yyyy) to (dd/mm/yyyy) and also how to change string into date format
new_date = DateTime.ParseExact(string_date.ToString,“DD-MMM-YY”, Globalization.CultureInfo.InvariantCulture).ToString(“DD/MM/YYYY”) this is not working

Hi @Sakshi_Jain !
Few questions so that we help you:

  • Are you using Outlook activities or IMAP activities to read the mails ?
  • For your pdf error, would you mind sending us a screenshot of the activity the error is related to ? (the problematic assign)
  • To help you overcome the conversion issue between datetime and string, would you mind telling us what is the culture of the date ? French date ? Other ? The format dd-MMM-yy does not seem to be an invariant culture (= US format), that’s why the conversion is not working. If you don’t know what is the culture format, provide us an example so we try to find the appropriate culture info

I am using outlook activates, but same thing if can do using code and get email details from exchanged web services that would be really good
Auto Download Outlook Email Attachment – Code in VBA by | Topbullets - A Digital Notebook
Download email attachments in .NET | Blog | Limilabs

pdf match error is resolved by variable datatype conversion

I am searching for for date
best regex for date to cover maximum cases/formats to get date in dd/mm/yyyy format
date can be like 26 March 21 , 19 Feb 2021,12 Feb 21,19 March 21
I remember previously matches activity had prewritten date regex a very long one that fetches date from any kind of text
Please share regex

@Sakshi_Jain - Not sure why exactly want to use Regex for your scenario?

If I understood correctly you want to convert date formats right? If my understandings are not correct, please provide your requirement in brief with input text and output expected for Regex…