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

public Class SMTPSenderFailedException

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

This exception is thrown when the message cannot be sent.

The exception includes the sender's address, which the mail server rejected.

Since
JavaMail 1.4.4

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
SMTPSenderFailedException(InternetAddress
the address that failed
addr
,
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
)

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

Method Summary

Modifier and TypeMethod and Description
public InternetAddress

Returns:

the address
getAddress
()

Return the address that failed.

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

SMTPSenderFailedExceptionback to summary
public SMTPSenderFailedException(InternetAddress addr, String cmd, int rc, String err)

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

Parameters
addr:InternetAddress

the address that failed

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

Method Detail

getAddressback to summary
public InternetAddress getAddress()

Return the address that failed.

Returns:InternetAddress

the address

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