Skip to main content
Question

Retrieve failed emails from loop

  • November 9, 2025
  • 1 reply
  • 21 views

Forum|alt.badge.img

Hi Techies,

I would like to know is there any way that we can retrieve the failed massages (due to invalid email) from outlook using loop in AA360. 

 

regards,

 

1 reply

Padmakumar
Premier Pathfinder | Tier 7
Forum|alt.badge.img+15
  • Premier Pathfinder | Tier 7
  • 1170 replies
  • November 10, 2025

Hi ​@jamalkaiser,

 

You can’t directly retrieve failed sent items from the Sent folder in Outlook via A360 because Outlook doesn’t store failures there. Instead, delivery failures (invalid email addresses, etc.) arrive as NDR/bounce emails in the mailbox (usually in Inbox, sometimes Junk). In A360, you can loop through those NDRs using the Outlook/Email package, filter by sender/subject, and parse out the invalid addresses.
 

What you can actually do is:

  • Identify bounce/NDR messages (typical subjects: Undeliverable:, Delivery has failed to these recipients or groups: Mail delivery failed: returning message to sender).
  • Common senders: System AdministratorMicrosoft Outlook, Mail Delivery Subsystem, postmaster@domain, or no-reply@….
  • Extract invalid recipient(s) and optionally the original subject, timestamp, and status code.


Using the Microsoft Outlook package (desktop Outlook)

Best when your bot runs on a machine with Outlook configured for the mailbox.

 

  • Open Outlook (ensure the profile is logged in).
  • Get emails from Inbox (and optionally Junk Email) with filters:

                1. Unread only = True (optional).

                2. Received since = last X days (optional).

  • Loop through the list of emails.
  • Filter NDRs by Sender and Subject patterns.
  • Parse the body for invalid addresses and error text (regex).

 

Using the Office 365 Email package (cloud, Graph/Exchange)

Use this if Outlook desktop isn’t available or you want a service-account approach.

  • Office 365: Connect (with OAuth app or service account).
  • Get emails from Inbox (and optionally Junk Email) with:

               * Query: subject filters like subject:(Undeliverable or Delivery has failed). 

 

  • Loop and parse similar to Option A.
  • Move/flag processed items.

 

 

Note: Outlook/Exchange doesn’t annotate Sent Items with delivery failure flags. The system sends a separate NDR message instead. So the canonical approach is to read NDRs, not Sent Items.