How to check whether the email has been received in the outlook with attachment

Hi Community,

In my case after completion of some activity , a mail gets generated and received automatically in the outlook with an attachment. I need to check if this mail has arrived in the inbox and whether it has attachments(.pdf) or not.

Please suggest some solns.

Thanks.

Hi @siddhi
Try like this

I hope it helps!!

Hi @siddhi

  1. Get Outlook Mail Messages
    → Account: “your_outlook_account”
    → Output: mailList

  2. For Each → item In mailList
    → Body -
    → If Condition - item.Attachments.Any(Function(a) a.Name.EndsWith(“.pdf”))

    If true:
    - Add the Save attachments activity to save the file

    If false:
    - Add any additional activities or log message activity to print logs in output panel.

Hope it helps!!

1 Like

@lrtetala ,

Thanks for the quick response.
Yes it worked, but i need to check

  1. whether it contains .pdf attachment or not
  2. Suppose m using some click activity before checking mail part. So my concern here is if mails were going after 2 minutes of performing my last activity then how can I check till that interval whether mail is received or not

@siddhi
In if condition give this
listMailmsg(N).Attachments.Where(function(x) x.Name.EndsWith(“pdf”)).Count > 0

Check out this thread

1 Like

@lrtetala @mkankatala

can you guys please suggest on this condition
Thanks.

@siddhi
Give delay of 2 min
image

1 Like

Hi @siddhi

Take a If condition after the Get outlook mail messages activity, In Get outlook mail message activity property check the unread mails option.
In If write the condition like mailList.Any if there is new mails it will read and save the attachments in the then block. In else block give the delay for 2 mins and do the next steps.
Check the below workflow for better understanding.

If you find the solution for your Querey mark the

Hope it helps!!

Thanks for the help.

Thank you @siddhi

Happy Automation!!

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