|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjavax.mail.Message
javax.mail.internet.MimeMessage
com.sun.mail.smtp.SMTPMessage
public class SMTPMessage
This class is a specialization of the MimeMessage class that allows you to specify various SMTP options and parameters that will be used when this message is sent over SMTP. Simply use this class instead of MimeMessage and set SMTP options using the methods on this class.
See the com.sun.mail.smtp package documentation for further information on the SMTP protocol provider.
MimeMessage| 嵌套类摘要 |
|---|
| 从类 javax.mail.internet.MimeMessage 继承的嵌套类/接口 |
|---|
MimeMessage.RecipientType |
| 字段摘要 | |
|---|---|
static int |
NOTIFY_DELAY
Notify of delivery delay |
static int |
NOTIFY_FAILURE
Notify of delivery failure |
static int |
NOTIFY_NEVER
Never notify of delivery status |
static int |
NOTIFY_SUCCESS
Notify of delivery success |
static int |
RETURN_FULL
Return full message with delivery status notification |
static int |
RETURN_HDRS
Return only message headers with delivery status notification |
| 从类 javax.mail.internet.MimeMessage 继承的字段 |
|---|
content, contentStream, dh, flags, headers, modified, saved |
| 从类 javax.mail.Message 继承的字段 |
|---|
expunged, folder, msgnum, session |
| 从接口 javax.mail.Part 继承的字段 |
|---|
ATTACHMENT, INLINE |
| 构造方法摘要 | |
|---|---|
SMTPMessage(MimeMessage source)
Constructs a new SMTPMessage with content initialized from the source MimeMessage. |
|
SMTPMessage(Session session)
Default constructor. |
|
SMTPMessage(Session session,
InputStream is)
Constructs an SMTPMessage by reading and parsing the data from the specified MIME InputStream. |
|
| 方法摘要 | |
|---|---|
boolean |
getAllow8bitMIME()
Is use of the 8BITMIME extension is allowed? |
String |
getEnvelopeFrom()
Return the envelope From address. |
String |
getMailExtension()
Gets the extension string to use with the MAIL command. |
int |
getNotifyOptions()
Get notification options. |
int |
getReturnOption()
Return return option. |
boolean |
getSendPartial()
Send message if some addresses are invalid? |
String |
getSubmitter()
Gets the submitter to be used for the RFC 2554 AUTH= value in the MAIL FROM command. |
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. |
void |
setEnvelopeFrom(String from)
Set the From address to appear in the SMTP envelope. |
void |
setMailExtension(String extension)
Set the extension string to use with the MAIL command. |
void |
setNotifyOptions(int options)
Set notification options to be used if the server supports Delivery Status Notification (RFC 1891). |
void |
setReturnOption(int option)
Set return option to be used if server supports Delivery Status Notification (RFC 1891). |
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. |
void |
setSubmitter(String submitter)
Sets the submitter to be used for the RFC 2554 AUTH= value in the MAIL FROM command. |
| 从类 javax.mail.Message 继承的方法 |
|---|
addRecipient, getFolder, getMessageNumber, isExpunged, match, setExpunged, setFlag, setMessageNumber, setRecipient |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 字段详细信息 |
|---|
public static final int NOTIFY_NEVER
public static final int NOTIFY_SUCCESS
public static final int NOTIFY_FAILURE
public static final int NOTIFY_DELAY
public static final int RETURN_FULL
public static final int RETURN_HDRS
| 构造方法详细信息 |
|---|
public SMTPMessage(Session session)
headers field is set to an empty InternetHeaders
object. The flags field is set to an empty Flags
object. The modified flag is set to true.
public SMTPMessage(Session session,
InputStream is)
throws MessagingException
session - Session object for this messageis - the message input stream
MessagingException
public SMTPMessage(MimeMessage source)
throws MessagingException
source MimeMessage. The new message is independent
of the original. Note: The current implementation is rather inefficient, copying the data more times than strictly necessary.
source - the message to copy content from
MessagingException| 方法详细信息 |
|---|
public void setEnvelopeFrom(String from)
If set, overrides the mail.smtp.from property.
from - the envelope From addresspublic String getEnvelopeFrom()
public void setNotifyOptions(int options)
NOTIFY_NEVER or some combination of
NOTIFY_SUCCESS, NOTIFY_FAILURE, and
NOTIFY_DELAY.
If set, overrides the mail.smtp.dsn.notify property.
options - notification optionspublic int getNotifyOptions()
public void setReturnOption(int option)
RETURN_FULL or RETURN_HDRS.
If set, overrides the mail.smtp.dsn.ret property.
option - return optionpublic int getReturnOption()
public void setAllow8bitMIME(boolean allow)
If true, overrides the mail.smtp.allow8bitmime property.
allow - allow 8-bit flagpublic boolean getAllow8bitMIME()
public void setSendPartial(boolean partial)
If true, overrides the mail.smtp.sendpartial property.
partial - send partial flagpublic boolean getSendPartial()
public String getSubmitter()
public void setSubmitter(String submitter)
submitter - the name of the submitterpublic String getMailExtension()
public void setMailExtension(String extension)
SMTPTransport
method supportsExtension
to verify that the server supports the desired service extension.
See RFC 1869
and other RFCs that define specific extensions. For example:
if (smtpTransport.supportsExtension("DELIVERBY"))
smtpMsg.setMailExtension("BY=60;R");
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||