|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.dalsemi.nethack.SmtpClient
Establishes connection with a mail server and sends mail messages using the SMTP Protocol.
| Field Summary | |
protected java.net.Socket |
sock
|
| Constructor Summary | |
SmtpClient()
Constructs new SmtpClient to port 25 with system property value of mailhost. |
|
SmtpClient(int port)
Constructs new SmtpClient with specified port. |
|
SmtpClient(java.lang.String server)
Constructs new SmtpClient and attaches to specified host. |
|
SmtpClient(java.lang.String server,
int port)
Opens a socket to the specified string and port. |
|
| Method Summary | |
void |
cc(java.lang.String recipient)
Parses to line of the message according to RFC specifications |
void |
closeMessage()
Send Message and close input/output streams |
void |
closeServer()
Close socket and reset all user inputs and outputs |
void |
from(java.lang.String sender)
Sends mail server "from:" command with the parameter specified by sender string. |
void |
openServer(java.lang.String server,
int port)
Opens a socket to the specified server and port number. |
SmtpPrintStream |
startMessage()
Send command to mail server to start data segment of the message |
void |
to(java.lang.String recipient)
Parses to line of the message according to RFC specifications |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected java.net.Socket sock
| Constructor Detail |
public SmtpClient(java.lang.String server,
int port)
throws java.io.IOException
server - ip number of the mail serverport - port number of the mail server
public SmtpClient(int port)
throws java.io.IOException
port - port number of the mail server
public SmtpClient(java.lang.String server)
throws java.io.IOException
s - ip number of the mail server
public SmtpClient()
throws java.io.IOException
| Method Detail |
public void closeServer()
throws java.io.IOException
public void openServer(java.lang.String server,
int port)
throws java.io.IOException,
java.net.UnknownHostException,
com.dalsemi.protocol.mailto.SmtpProtocolException
server - ip number of the mail serverport - port number of the mail server
public void from(java.lang.String sender)
throws com.dalsemi.protocol.mailto.SmtpProtocolException,
java.io.IOException
sender - Sender of the mail message
public SmtpPrintStream startMessage()
throws com.dalsemi.protocol.mailto.SmtpProtocolException,
java.io.IOException
public void cc(java.lang.String recipient)
throws com.dalsemi.protocol.mailto.SmtpProtocolException,
java.io.IOException
To: - of the message
public void to(java.lang.String recipient)
throws com.dalsemi.protocol.mailto.SmtpProtocolException,
java.io.IOException
To: - of the message
public void closeMessage()
throws java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||