|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface SMTPClient
General interface to the SMTP clients.
Version History
EPG - Adapted from another project - 23 NOV 06
| Method Summary | |
|---|---|
Reply |
connect(java.lang.String connectAddress,
int connectPort)
Start a connection. |
Reply |
disconnect()
Start a connection. |
Reply |
done()
Quit the client. |
java.lang.String |
getName()
Get client name. |
SMTPState |
getState()
Get the state. |
Reply |
login(java.lang.String hostname)
HELO with the hostname--no authentication. |
Reply |
recipient(java.lang.String recipientText)
Set the recipient using RCPT TO. |
Reply |
recipient(java.lang.String recipientText,
DSN dsn)
Set the recipient using RCPT TO. |
Reply |
reset()
RESET the connection. |
Reply |
sendData(java.io.InputStream... ios)
Send DATA. |
Reply |
sender(java.lang.String senderText)
Set the sender using MAIL FROM. |
Reply |
sender(java.lang.String senderText,
DSN dsn)
Set the sender using MAIL FROM. |
void |
setSocketRetries(int retries)
Number of times a socket read will be retried after a timeout before completely giving up. The default value is CONNECTION_RETRIES. |
void |
setTimeout(int timeout)
Set the socket timeout for each connection. |
| Field Detail |
|---|
static final int CONNECTION_TIMEOUT
static final int CONNECTION_RETRIES
static final int CODE_211
static final int CODE_214
static final int CODE_215
static final int CODE_220
static final int CODE_221
static final int CODE_250
static final int CODE_251
static final int CODE_354
static final int CODE_421
static final int CODE_FAIL_THRESHOLD
static final int CODE_450
static final int CODE_451
static final int CODE_452
static final int CODE_500
static final int CODE_501
static final int CODE_502
static final int CODE_503
static final int CODE_504
static final int CODE_550
static final int CODE_551
static final int CODE_552
static final int CODE_553
static final int CODE_554
static final int SYSTEM_STATUS
static final int HELP_MESSAGE
static final int SERVICE_READY
static final int SERVICE_CLOSING_TRANSMISSION_CHANNEL
static final int ACTION_OK
static final int USER_NOT_LOCAL_WILL_FORWARD
static final int START_MAIL_INPUT
static final int SERVICE_NOT_AVAILABLE
static final int ACTION_NOT_TAKEN
static final int ACTION_ABORTED
static final int INSUFFICIENT_STORAGE
static final int UNRECOGNIZED_COMMAND
static final int SYNTAX_ERROR_IN_ARGUMENTS
static final int COMMAND_NOT_IMPLEMENTED
static final int BAD_COMMAND_SEQUENCE
static final int COMMAND_NOT_IMPLEMENTED_FOR_PARAMETER
static final int MAILBOX_UNAVAILABLE
static final int USER_NOT_LOCAL
static final int STORAGE_ALLOCATION_EXCEEDED
static final int MAILBOX_NAME_NOT_ALLOWED
static final int TRANSACTION_FAILED
| Method Detail |
|---|
java.lang.String getName()
SMTPState getState()
void setTimeout(int timeout)
It will take effect whenever a new connection is established.
timeout - the timeout in milliseconds.void setSocketRetries(int retries)
It will take effect whenever a new operation is started.
retries - Number of retries. Zero or a negative number is the same as no retries.
Reply connect(java.lang.String connectAddress,
int connectPort)
throws ThingsException,
java.lang.InterruptedException
connectAddress - connectPort -
ThingsException - will always be fatal at this point.
java.lang.InterruptedException
Reply disconnect()
throws ThingsException,
java.lang.InterruptedException
ThingsException - which will never happen, since we'll just abandon the bad connection.
java.lang.InterruptedException
Reply login(java.lang.String hostname)
throws ThingsException,
java.lang.InterruptedException
hostname -
ThingsException
java.lang.InterruptedException
Reply sender(java.lang.String senderText)
throws ThingsException,
java.lang.InterruptedException
senderText - as a valid SMTP address.
ThingsException - if not ready for MAIL FROM or actual transmission problem.
java.lang.InterruptedException
Reply sender(java.lang.String senderText,
DSN dsn)
throws ThingsException,
java.lang.InterruptedException
senderText - as a valid SMTP address.dsn - command. If null, it will be ignored.
ThingsException - if not ready for MAIL FROM or actual transmission problem.
java.lang.InterruptedException
Reply recipient(java.lang.String recipientText)
throws ThingsException,
java.lang.InterruptedException
recipientText - as a valid SMTP address.
ThingsException - if not ready for RCPT TO or actual transmission problem.
java.lang.InterruptedException
Reply recipient(java.lang.String recipientText,
DSN dsn)
throws ThingsException,
java.lang.InterruptedException
recipientText - as a valid SMTP address.dsn - command. If null, it will be ignored.
ThingsException - if not ready for RCPT TO or actual transmission problem.
java.lang.InterruptedException
Reply reset()
throws ThingsException,
java.lang.InterruptedException
ThingsException - if the connection is made and logged in.
java.lang.InterruptedException
Reply sendData(java.io.InputStream... ios)
throws ThingsException,
java.lang.InterruptedException
ios - Stream to send. You handle any buffering. Null entries are allowed and ignored.
ThingsException
java.lang.InterruptedException
Reply done()
throws ThingsException,
java.lang.InterruptedException
ThingsException
java.lang.InterruptedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||