Package jakarta.mail
Class SendFailedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
jakarta.mail.MessagingException
jakarta.mail.SendFailedException
- All Implemented Interfaces:
Serializable
This exception is thrown when the message cannot be sent.
The exception includes those addresses to which the message could not be sent as well as the valid addresses to which the message was sent and valid addresses to which the message was not sent.
- Author:
- John Mani, Max Spivak
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionConstructs a SendFailedException with no detail message.Constructs a SendFailedException with the specified detail message.Constructs a SendFailedException with the specified Exception and detail message.SendFailedException
(String msg, Exception ex, Address[] validSent, Address[] validUnsent, Address[] invalid) Constructs a SendFailedException with the specified string and the specified address objects. -
Method Summary
Methods inherited from class jakarta.mail.MessagingException
getCause, getNextException, setNextException, toString
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Field Details
-
invalid
The invalid addresses. -
validSent
Valid addresses to which message was sent. -
validUnsent
Valid addresses to which message was not sent.
-
-
Constructor Details
-
SendFailedException
public SendFailedException()Constructs a SendFailedException with no detail message. -
SendFailedException
Constructs a SendFailedException with the specified detail message.- Parameters:
s
- the detail message
-
SendFailedException
Constructs a SendFailedException with the specified Exception and detail message. The specified exception is chained to this exception.- Parameters:
s
- the detail messagee
- the embedded exception- See Also:
-
SendFailedException
public SendFailedException(String msg, Exception ex, Address[] validSent, Address[] validUnsent, Address[] invalid) Constructs a SendFailedException with the specified string and the specified address objects.- Parameters:
msg
- the detail messageex
- the embedded exceptionvalidSent
- valid addresses to which message was sentvalidUnsent
- valid addresses to which message was not sentinvalid
- the invalid addresses- See Also:
-
-
Method Details
-
getValidSentAddresses
Return the addresses to which this message was sent succesfully.- Returns:
- Addresses to which the message was sent successfully or null
-
getValidUnsentAddresses
Return the addresses that are valid but to which this message was not sent.- Returns:
- Addresses that are valid but to which the message was not sent successfully or null
-
getInvalidAddresses
Return the addresses to which this message could not be sent.- Returns:
- Addresses to which the message sending failed or null;
-