Represents the results of a message that was scanned.
public class BounceResult
Public Class BounceResult
public ref class BounceResult
Shows how to process mail messages on a local disk.
using System;
using ComponentPro.Net.Mail;
...
// Create a new instance of the BounceInspector class.
BounceInspector inspector = new BounceInspector();
// Process all EML files in directory 'c:\\temp'.
BounceResultCollection result = inspector.ProcessMessages("c:\\temp");
// Display processed emails.
foreach (BounceResult r in result)
{
// If this message was identified as a bounced email message.
if (r.Identified)
{
// Print out the result
Console.Write("FileName: {0}\nSubject: {1}\nAddress: {2}\n" +
"Bounce Category: {3}\n" +
"Bounce Type: {4}\nDeleted: {5}\n" +
"DSN Action: {6}\n" +
"DSN Diagnostic Code: {7}\n\n",
System.IO.Path.GetFileName(r.FilePath),
r.MailMessage.Subject,
r.Addresses[0],
r.BounceCategory.Name,
r.BounceType.Name,
r.FileDeleted,
r.Dsn.Action,
r.Dsn.DiagnosticCode);
}
}
Console.WriteLine("{0} bounced message found", result.BounceCount);
Imports ComponentPro.Net.Mail
...
' Create a new instance of the BounceInspector class.
Dim inspector As New BounceInspector()
' Process all EML files in directory 'c:\\temp'.
Dim result As BounceResultCollection = inspector.ProcessMessages("c:\temp")
' Display processed emails.
For Each r As BounceResult In result
' If this message was identified as a bounced email message.
If r.Identified Then
' Print out the result
Console.Write("FileName: {0}" & vbLf & "Subject: {1}" & vbLf & "Address: {2}" & vbLf & "Bounce Category: {3}" & vbLf & "Bounce Type: {4}" & vbLf & "Deleted: {5}" & vbLf & "DSN Action: {6}" & vbLf & "DSN Diagnostic Code: {7}" & vbLf & vbLf, System.IO.Path.GetFileName(r.FilePath), r.MailMessage.Subject, r.Addresses(0), r.BounceCategory.Name, r.BounceType.Name, r.FileDeleted, r.Dsn.Action, r.Dsn.DiagnosticCode)
End If
Next r
Console.WriteLine("{0} bounced message found", result.BounceCount)
ComponentPro.Net.Mail.ComponentPro.Net.Mail.BounceResult