Sample code for 30+ languages & platforms
VB.NET Requires Chilkat v11.0.0+

Read the recipient results in a delivery status report

See more Email Object Examples

Check the report type before reading DSN-specific fields. One report may describe multiple recipients. Retain the per-recipient information in GetDsnInfo instead of assigning one status to every delivery.

Chilkat VB.NET Downloads

VB.NET
Dim success As Boolean = False

'  Assumes Chilkat is unlocked. See Global Unlock Sample.

Dim email As New Chilkat.Email
success = email.LoadEml("delivery-status.eml")
If (success <> True) Then
    Debug.WriteLine(email.LastErrorText)
    Exit Sub
End If

If (email.IsMultipartReport() <> True) Then
    Debug.WriteLine("This message is not a multipart report.")
    Exit Sub
End If

If (email.GetNumPartsOfType("message/delivery-status",False,False) = 0) Then
    Debug.WriteLine("No delivery-status part in this report.")
    Exit Sub
End If

If (email.HasPlainTextBody() = True) Then
    Debug.WriteLine(email.GetPlainTextBody())
End If

Dim details As New Chilkat.JsonObject
success = email.GetDsnInfo(details)
If (success <> True) Then
    Debug.WriteLine(email.LastErrorText)
    Exit Sub
End If

details.EmitCompact = False
Debug.WriteLine(details.Emit())