public class MailSendException extends MailException
| 构造器和说明 |
|---|
MailSendException(Map<Object,Exception> failedMessages)
Constructor for registration of failed messages, with the
messages that failed as keys, and the thrown exceptions as values.
|
MailSendException(String msg)
Constructor for MailSendException.
|
MailSendException(String msg,
Throwable cause)
Constructor for MailSendException.
|
MailSendException(String msg,
Throwable cause,
Map<Object,Exception> failedMessages)
Constructor for registration of failed messages, with the
messages that failed as keys, and the thrown exceptions as values.
|
| 限定符和类型 | 方法和说明 |
|---|---|
Map<Object,Exception> |
getFailedMessages()
Return a Map with the failed messages as keys, and the thrown exceptions
as values.
|
String |
getMessage() |
Exception[] |
getMessageExceptions()
Return an array with thrown message exceptions.
|
static boolean |
isEmpty(Object[] array) |
void |
printStackTrace(PrintStream ps) |
void |
printStackTrace(PrintWriter pw) |
String |
toString() |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, setStackTracepublic MailSendException(String msg)
msg - the detail messagepublic MailSendException(String msg, Throwable cause)
msg - the detail messagecause - the root cause from the mail API in usepublic MailSendException(String msg, Throwable cause, Map<Object,Exception> failedMessages)
The messages should be the same that were originally passed to the invoked send method.
msg - the detail messagecause - the root cause from the mail API in usefailedMessages - Map of failed messages as keys and thrown
exceptions as valuespublic MailSendException(Map<Object,Exception> failedMessages)
The messages should be the same that were originally passed to the invoked send method.
failedMessages - Map of failed messages as keys and thrown
exceptions as valuespublic final Map<Object,Exception> getFailedMessages()
Note that a general mail server connection failure will not result in failed messages being returned here: A message will only be contained here if actually sending it was attempted but failed.
The messages will be the same that were originally passed to the invoked send method, that is, SimpleMailMessages in case of using the generic MailSender interface.
In case of sending MimeMessage instances via JavaMailSender, the messages will be of type MimeMessage.
NOTE: This Map will not be available after serialization.
Use getMessageExceptions() in such a scenario, which will
be available after serialization as well.
SimpleMailMessage,
MimeMessagepublic final Exception[] getMessageExceptions()
Note that a general mail server connection failure will not result in failed messages being returned here: A message will only be contained here if actually sending it was attempted but failed.
public String getMessage()
getMessage 在类中 Throwablepublic void printStackTrace(PrintStream ps)
printStackTrace 在类中 Throwablepublic void printStackTrace(PrintWriter pw)
printStackTrace 在类中 Throwablepublic static boolean isEmpty(Object[] array)
Copyright © 2017. All rights reserved.