DeliveryStatus (JavaMail API documentation)
Date: 2018-05-06

com.sun.mail.dsn

## Class DeliveryStatus

- java.lang.Object
- - com.sun.mail.dsn.Report
  - - com.sun.mail.dsn.DeliveryStatus

-     public class DeliveryStatus
      extends Report

  A message/delivery-status message content, as defined in RFC 3464.
  Since:
    JavaMail 1.4

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected InternetHeaders` | `messageDSN` The DSN fields for the message.
    `protected InternetHeaders[]` | `recipientDSN` The DSN fields for each recipient.

    - ### Fields inherited from class com.sun.mail.dsn.Report

      `type`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DeliveryStatus()` Construct a delivery status notification with no content.
    `DeliveryStatus(java.io.InputStream is)` Construct a delivery status notification by parsing the supplied input stream.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addRecipientDSN(InternetHeaders h)` Add deliver status notification information for another recipient.
    `InternetHeaders` | `getMessageDSN()` Return all the per-message fields in the delivery status notification.
    `InternetHeaders` | `getRecipientDSN(int n)` Return the delivery status notification information for the specified recipient.
    `int` | `getRecipientDSNCount()` Return the number of recipients for which we have per-recipient delivery status notification information.
    `void` | `setMessageDSN(InternetHeaders messageDSN)` Set the per-message fields in the delivery status notification.
    `java.lang.String` | `toString()`
    `void` | `writeTo(java.io.OutputStream os)`

    - ### Methods inherited from class com.sun.mail.dsn.Report

      `getType`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### messageDSN

          protected InternetHeaders messageDSN

      The DSN fields for the message.

    - #### recipientDSN

          protected InternetHeaders[] recipientDSN

      The DSN fields for each recipient.

  - ### Constructor Detail

    - #### DeliveryStatus

          public DeliveryStatus()
                         throws MessagingException

      Construct a delivery status notification with no content.
      Throws:
        `MessagingException`

    - #### DeliveryStatus

          public DeliveryStatus(java.io.InputStream is)
                         throws MessagingException,
                                java.io.IOException

      Construct a delivery status notification by parsing the supplied input stream.
      Throws:
        `MessagingException`
        `java.io.IOException`

  - ### Method Detail

    - #### getMessageDSN

          public InternetHeaders getMessageDSN()

      Return all the per-message fields in the delivery status notification. The fields are defined as:

              per-message-fields =
                    [ original-envelope-id-field CRLF ]
                    reporting-mta-field CRLF
                    [ dsn-gateway-field CRLF ]
                    [ received-from-mta-field CRLF ]
                    [ arrival-date-field CRLF ]
                    *( extension-field CRLF )

    - #### setMessageDSN

          public void setMessageDSN(InternetHeaders messageDSN)

      Set the per-message fields in the delivery status notification.

    - #### getRecipientDSNCount

          public int getRecipientDSNCount()

      Return the number of recipients for which we have per-recipient delivery status notification information.

    - #### getRecipientDSN

          public InternetHeaders getRecipientDSN(int n)

      Return the delivery status notification information for the specified recipient.

    - #### addRecipientDSN

          public void addRecipientDSN(InternetHeaders h)

      Add deliver status notification information for another recipient.

    - #### writeTo

          public void writeTo(java.io.OutputStream os)
                       throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

Copyright © 1996-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms< /a>.