0

is there anyway to know if delivery-status is sucess or failure using openpop?

ContentType {multipart/report; report-type=delivery-status;
boundary=24a0c351-fefd-4069-ac9e-a140c0e98b78}  
System.Net.Mime.ContentType


using (Pop3Client client = new Pop3Client())
{
    client.Connect(server, 110, false);
    client.Authenticate(Usuario, Password, AuthenticationMethod.Auto);

    int messageCount = client.GetMessageCount();

    List<Message> allMessages = new List<Message>(messageCount);

    for (int i = messageCount; i > 0; i--)
    {
    allMessages.Add(client.GetMessage(i));
    }
}
Alessio
  • 3,404
  • 19
  • 35
  • 48

1 Answers1

0

i'm found this solution https://github.com/eric-b/DSN-Parser

MailDeliveryInfo.TryCreate(string rawMessage)

Evaluates MailDeliveryInfo.IsDsn(rawMessage) and tries to parse the report. Returns null if it fails or if it is not a report.

Informations parsed

Basically, each instance of MailDeliveryInfo defines:

a date, the raw report (with Content-Type: message/delivery-status), a list of status, each associated with an e-mail (see below), an arbitrary Uid property (not filled by the helper methods): can be used by the caller to store the report identifier (from POP3 for example). The headers of the original (not delivered) message are also accessible.

Each status defines basically:

an action (ie "Failed", "Delayed", "Delivered", "Relayed" or "Expanded"), a status code (ie. "5.1.1"), a classification string (ie. "PermanentFailure/AddressingStatus/BadDestinationMailboxAddress"), a diagnostic code (ie "smtp; 550-5.1.1 The email account that you tried to reach does not exist.").