Hi, referring to this solution: https://forum.uipath.com/t/i-want-to-get-the-count-of-emails-that-i-have-received-in-between-12am-to-23-59-on-a-particular-date-please-help/343870
I’m trying to perform the same activity but get ‘date’ is not a member of ‘system.net.mail.mailmessage’ error message on the expression: MailMessages.Where(function(x) Convert.ToDateTime(x.date).ToString(“dd/MM/yyyy”)=Date.Now.ToString(“dd/MM/yyyy”)).Count
I’m a beginner, this is my first robot.
Thanks a lot
ppr
(Peter Preuss)
August 17, 2022, 5:28pm
2
@Giovanni_Mac
Welcome to the forum
We assume you are working with get outlook Mail Message activitiy - output: MailMessagesVar
In general we would suggest to work with filters: Get Outlook Mail Messages
Getting the LINQ (for VB) working give a try at (a defensive one)
MailMessagesVar.Where(Function (x) x.Headers.AllKeys.Contains("Date") AndAlso x.DateAsDateTime.Date = Now.Date).Count
when the received date is targeted then also the following variation can work:
MailMessagesVar.Where(Function (x) x.Headers.AllKeys.Contains("DateRecieved") AndAlso CDate(x.Headers("DateRecieved")).Date.equals(Now.Date)).Count
For training purpose we also would suggest to explore a single mail within the immediate panel by e.g.
MailMessagesVar(0) and its properties and methods
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum
Once above will work we can rewrite the LINQ and incorporate the UTC Offset as well
Yoichi
(Yoichi)
August 18, 2022, 12:13am
3
Hi,
The recent Mail.Actvities package has issue of date in MailMessage.
Hi,
with “get outlook mail messages” I read attachements into [image].
For every message I write line “item.subject” and “item.date”.
It worked fine until yesterday afternoon. Since then “item.date” is giving error message:
“Write Line: The given mail message does not specify a date.”
Read mails are being still the same.
I would appreciate any help.
Thx and kind regards,
Vanja
Hi Team,
I am currently using mailmessage(System.Net.Mail.MailMessage) variable in UiPath Studio Community Edition version 2022.7.0-beta.9548. It doesn’t have an option to read the Receiving Date. Can you please look into this issue once.
Attached the screenshot for your reference.
[image]
If you use Mail.Activities package 1.11.4 or above, can you try to downgrade to 1.13.1-preview or 1.12.3, then try your expression or @ppr 's solution.
Regards,
1 Like
Worked with this. Thanks!
system
(system)
Closed
August 21, 2022, 9:17am
5
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.