Detect and Process Bounced Emails

Contents
[ ]

When sending emails, some messages may fail to reach their recipients, for example, due to an invalid recipient address or a full mailbox. These undelivered messages are known as bounced emails.

Aspose.Email for C++ provides a convenient way to detect and analyze bounced messages using the MailMessage and BounceResult classes. The MailMessage::CheckBounced() method determines whether a message is a bounce and returns a BounceResult object that contains detailed information such as:

  • Whether the message is bounced
  • The recipient address
  • The type of bounce action
  • The reason and status code of the bounce

This allows developers to automatically identify delivery failures and take appropriate action like cleaning invalid addresses from mailing lists.

The following code example demonstrates how to check if an email message has bounced and retrieve detailed information about it: