Receive acknowledgment of Email failure with distributed list

peter liles 556 Reputation points
2021-08-16T12:47:29.203+00:00

I am testing my email function in developer connected to internet and when sending to a distributed list of receivers the program does not catch those receivers that fail to be delivered if any are a success. I just get a message to my email account to inform me of none delivery to specific user.

*For i As Integer = 0 To recipients.Count() - 1

            mailMessage.To.Clear()
            mailMessage.To.Add(New System.Net.Mail.MailAddress(recipients(i).EmailAddress, recipients(i).UserName))

    Next

Dim userState As Object = mailMessage
Try

        smtpClient.SendAsync(mailMessage, userState)
    Catch failedRec As System.Net.Mail.SmtpFailedRecipientsException
        'Choose to resend?

End Try*
I was hoping to catch each recipient exception here ? so that i can process a failure to send notice instead of a current success as is the case on both failure and succeed.

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,254 questions
{count} votes

2 answers

Sort by: Most helpful
  1. peter liles 556 Reputation points
    2021-08-18T19:36:38.117+00:00

    I get the following message delivered to my account. Is this the standard reply when unable to send to recipients address?
    According to your answer then i am unable to verify if message was delivered to recipients address successfully?

    Is there an alternative approach to DL's such as execute the object SmtpClient.SendAsync(mailMessage) for each recipient address instead and would then return a failure response from server.

    Mail Delivery Subsystem <mailer-daemon@grigogon@gmail.com .com>
    To:

    Wed, 18 Aug at 20:20

    Error Icon
    Address not found
    Your message wasn't delivered to fdgh@Madesh .com because the address couldn't be found, or is unable to receive mail.
    LEARN MORE
    The response was:
    The email account that you tried to reach does not exist. Please try double-checking the recipient's email address for typos or unnecessary spaces. Learn more at https://support.google.com/mail/answer/6596


  2. peter liles 556 Reputation points
    2021-08-20T14:41:44.857+00:00

    i want to retrieve the failure notification message that is sent to my yahoo account. I can read it by login to my yahoo account but i would prefer to access it and read at my computer after i send the list of messages.