See the com.sun.mail.smtp package documentation for further information on the SMTP protocol provider.
javax.mail.internet.MimeMessage
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private String | |
| private String | |
| public static final int | NOTIFY_DELAY
Notify of delivery delay |
| public static final int | NOTIFY_FAILURE
Notify of delivery failure |
| public static final int | NOTIFY_NEVER
Never notify of delivery status |
| public static final int | NOTIFY_SUCCESS
Notify of delivery success |
| private int | |
| public static final int | RETURN_FULL
Return full message with delivery status notification |
| public static final int | RETURN_HDRS
Return only message headers with delivery status notification |
| private int | |
| private static final String[] | |
| private boolean | |
| private String |
| Access | Constructor and Description |
|---|---|
| public | |
| public | SMTPMessage(Session
Session object for this message session, InputStream the message input stream is)Constructs an SMTPMessage by reading and parsing the data from the specified MIME InputStream. |
| public | SMTPMessage(MimeMessage
the message to copy content from source)Constructs a new SMTPMessage with content initialized from the
|
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| pack-priv String | |
| pack-priv String | |
| public String | Returns: the envelope From address, or null if not setReturn the envelope From address. |
| public String | Returns: the extension stringGets the extension string to use with the MAIL command. |
| public int | |
| public int | |
| public boolean | |
| public String | Returns: the name of the submitter.Gets the submitter to be used for the RFC 2554 AUTH= value in the MAIL FROM command. |
| public void | setAllow8bitMIME(boolean
allow 8-bit flag allow)If set to true, and the server supports the 8BITMIME extension, text parts of this message that use the "quoted-printable" or "base64" encodings are converted to use "8bit" encoding if they follow the RFC 2045 rules for 8bit text. |
| public void | setEnvelopeFrom(String
the envelope From address from)Set the From address to appear in the SMTP envelope. |
| public void | setMailExtension(String
the extension string extension)Set the extension string to use with the MAIL command. |
| public void | setNotifyOptions(int
notification options options)Set notification options to be used if the server supports Delivery Status Notification (RFC 1891). |
| public void | setReturnOption(int
return option option)Set return option to be used if server supports Delivery Status Notification (RFC 1891). |
| public void | setSendPartial(boolean
send partial flag partial)If set to true, and this message has some valid and some invalid addresses, send the message anyway, reporting the partial failure with a SendFailedException. |
| public void | setSubmitter(String
the name of the submitter submitter)Sets the submitter to be used for the RFC 2554 AUTH= value in the MAIL FROM command. |
| allow8bitMIME | back to summary |
|---|---|
| private boolean allow8bitMIME | |
| envelopeFrom | back to summary |
|---|---|
| private String envelopeFrom | |
| extension | back to summary |
|---|---|
| private String extension | |
| NOTIFY_DELAY | back to summary |
|---|---|
| public static final int NOTIFY_DELAY Notify of delivery delay | |
| NOTIFY_FAILURE | back to summary |
|---|---|
| public static final int NOTIFY_FAILURE Notify of delivery failure | |
| NOTIFY_NEVER | back to summary |
|---|---|
| public static final int NOTIFY_NEVER Never notify of delivery status | |
| NOTIFY_SUCCESS | back to summary |
|---|---|
| public static final int NOTIFY_SUCCESS Notify of delivery success | |
| notifyOptions | back to summary |
|---|---|
| private int notifyOptions | |
| RETURN_FULL | back to summary |
|---|---|
| public static final int RETURN_FULL Return full message with delivery status notification | |
| RETURN_HDRS | back to summary |
|---|---|
| public static final int RETURN_HDRS Return only message headers with delivery status notification | |
| returnOption | back to summary |
|---|---|
| private int returnOption | |
| returnOptionString | back to summary |
|---|---|
| private static final String[] returnOptionString | |
| sendPartial | back to summary |
|---|---|
| private boolean sendPartial | |
| submitter | back to summary |
|---|---|
| private String submitter | |
| SMTPMessage | back to summary |
|---|---|
| public SMTPMessage(Session session) Default constructor. An empty message object is created.
The
| |
| SMTPMessage | back to summary |
|---|---|
| public SMTPMessage(Session session, InputStream is) throws MessagingException Constructs an SMTPMessage by reading and parsing the data from the specified MIME InputStream. The InputStream will be left positioned at the end of the data for the message. Note that the input stream parse is done within this constructor itself.
| |
| SMTPMessage | back to summary |
|---|---|
| public SMTPMessage(MimeMessage source) throws MessagingException Constructs a new SMTPMessage with content initialized from the
Note The current implementation is rather inefficient, copying the data more times than strictly necessary.
| |
| getAllow8bitMIME | back to summary |
|---|---|
| public boolean getAllow8bitMIME() Is use of the 8BITMIME extension is allowed?
| |
| getDSNNotify | back to summary |
|---|---|
| pack-priv String getDSNNotify() Return notification options as an RFC 1891 string. Returns null if no options set. | |
| getDSNRet | back to summary |
|---|---|
| pack-priv String getDSNRet() Return return option as an RFC 1891 string. Returns null if no option set. | |
| getEnvelopeFrom | back to summary |
|---|---|
| public String getEnvelopeFrom() Return the envelope From address.
| |
| getMailExtension | back to summary |
|---|---|
| public String getMailExtension() Gets the extension string to use with the MAIL command.
| |
| getNotifyOptions | back to summary |
|---|---|
| public int getNotifyOptions() Get notification options. Returns zero if no options set.
| |
| getReturnOption | back to summary |
|---|---|
| public int getReturnOption() Return return option. Returns zero if no option set.
| |
| getSendPartial | back to summary |
|---|---|
| public boolean getSendPartial() Send message if some addresses are invalid?
| |
| getSubmitter | back to summary |
|---|---|
| public String getSubmitter() Gets the submitter to be used for the RFC 2554 AUTH= value in the MAIL FROM command.
| |
| setAllow8bitMIME | back to summary |
|---|---|
| public void setAllow8bitMIME(boolean allow) If set to true, and the server supports the 8BITMIME extension, text parts of this message that use the "quoted-printable" or "base64" encodings are converted to use "8bit" encoding if they follow the RFC 2045 rules for 8bit text.
If true, overrides the
| |
| setEnvelopeFrom | back to summary |
|---|---|
| public void setEnvelopeFrom(String from) Set the From address to appear in the SMTP envelope. Note that this is different than the From address that appears in the message itself. The envelope From address is typically used when reporting errors. See RFC 821 for details.
If set, overrides the
| |
| setMailExtension | back to summary |
|---|---|
| public void setMailExtension(String extension) Set the extension string to use with the MAIL command.
The extension string can be used to specify standard SMTP
service extensions as well as vendor-specific extensions.
Typically the application should use the
For example:
| |
| setNotifyOptions | back to summary |
|---|---|
| public void setNotifyOptions(int options) Set notification options to be used if the server supports
Delivery Status Notification
(RFC 1891).
Either
If set, overrides the
| |
| setReturnOption | back to summary |
|---|---|
| public void setReturnOption(int option) Set return option to be used if server supports
Delivery Status Notification
(RFC 1891).
Either
If set, overrides the
| |
| setSendPartial | back to summary |
|---|---|
| public void setSendPartial(boolean partial) If set to true, and this message has some valid and some invalid addresses, send the message anyway, reporting the partial failure with a SendFailedException. If set to false (the default), the message is not sent to any of the recipients if there is an invalid recipient address.
If true, overrides the
| |
| setSubmitter | back to summary |
|---|---|
| public void setSubmitter(String submitter) Sets the submitter to be used for the RFC 2554 AUTH= value in the MAIL FROM command. Normally only used by a server that's relaying a message. Clients will typically not set a submitter. See RFC 2554 for details.
| |