Top Description Fields Constructors Methods
com.sun.mail.smtp

public Class SMTPSendFailedException

extends SendFailedException
Class Inheritance
Imports
javax.mail.Address, .SendFailedException, javax.mail.internet.InternetAddress

This exception is thrown when the message cannot be sent.

This exception will usually appear first in a chained list of exceptions, followed by SMTPAddressFailedExceptions and/or SMTPAddressSucceededExceptions, * one per address. This exception corresponds to one of the SMTP commands used to send a message, such as the MAIL, DATA, and "end of data" commands, but not including the RCPT command.

Since
JavaMail 1.3.2

Field Summary

Modifier and TypeField and Description
protected InternetAddress
protected String
protected int
private static final long
Inherited from javax.mail.SendFailedException:
invalidvalidSentvalidUnsent

Constructor Summary

AccessConstructor and Description
public
SMTPSendFailedException(String
the command that was sent to the SMTP server
cmd
,
int
the SMTP return code indicating the failure
rc
,
String
the error string from the SMTP server
err
,
Exception
a chained exception
ex
,
Address[]
the valid addresses the message was sent to
vs
,
Address[]
the valid addresses the message was not sent to
vus
,
Address[]
the invalid addresses
inv
)

Constructs an SMTPSendFailedException with the specified address, return code, and error string.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the command
getCommand
()

Return the command that failed.

public int

Returns:

the return code
getReturnCode
()

Return the return code from the SMTP server that indicates the reason for the failure.

Inherited from javax.mail.SendFailedException:
getInvalidAddressesgetValidSentAddressesgetValidUnsentAddresses

Field Detail

addrback to summary
protected InternetAddress addr
cmdback to summary
protected String cmd
rcback to summary
protected int rc
serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.mail.SendFailedException.serialVersionUID.

Constructor Detail

SMTPSendFailedExceptionback to summary
public SMTPSendFailedException(String cmd, int rc, String err, Exception ex, Address[] vs, Address[] vus, Address[] inv)

Constructs an SMTPSendFailedException with the specified address, return code, and error string.

Parameters
cmd:String

the command that was sent to the SMTP server

rc:int

the SMTP return code indicating the failure

err:String

the error string from the SMTP server

ex:Exception

a chained exception

vs:Address[]

the valid addresses the message was sent to

vus:Address[]

the valid addresses the message was not sent to

inv:Address[]

the invalid addresses

Method Detail

getCommandback to summary
public String getCommand()

Return the command that failed.

Returns:String

the command

getReturnCodeback to summary
public int getReturnCode()

Return the return code from the SMTP server that indicates the reason for the failure. See RFC 821 for interpretation of the return code.

Returns:int

the return code