|
CONGO AppServer | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.ObjectSmtp
The Simple Mail Transfer Protocol class. This class was borrowed for the GJT, and scaled to do just what we require.
| Field Summary | |
static java.lang.String |
REVISION
The current CVS revision of this class |
| Constructor Summary | |
Smtp(java.lang.String server)
Connects to the specified SMTP server, on the default (and standard) port 25. |
|
Smtp(java.lang.String server,
int port)
Connects to the specified SMTP server on a given port |
|
| Method Summary | |
void |
close()
Closes down the connection to the server |
java.io.PrintWriter |
getOutputStream()
Gets the PrintWriter allowing data to be sent directly to the SMTP server |
void |
sendCommand(java.lang.String cmd,
int reply)
Sends a command to the server |
void |
sendMessage()
Completes and sends the current message |
void |
setSender(java.lang.String sender)
Specify who the message is from |
void |
setTo(java.lang.String to)
Specify who the message is to be sent to |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String REVISION
| Constructor Detail |
public Smtp(java.lang.String server)
throws java.io.IOException
server - The SMTP server to use
java.io.IOException - if the connection to the server fails
public Smtp(java.lang.String server,
int port)
throws java.io.IOException
server - The SMTP server to useport - The SMTP server port
java.io.IOException - if the connection to the server fails| Method Detail |
public void close()
throws java.io.IOException
java.io.IOException - if the command fails
public void setSender(java.lang.String sender)
throws java.io.IOException
sender - the e-mail address of the sender
java.io.IOException - if the command fails
public void setTo(java.lang.String to)
throws java.io.IOException
to - the e-mail address of the receiver
java.io.IOException - if the command fails
public java.io.PrintWriter getOutputStream()
throws java.io.IOException
java.io.IOException - if the command fails
public void sendMessage()
throws java.io.IOException
java.io.IOException - if the command fails
public void sendCommand(java.lang.String cmd,
int reply)
throws java.io.IOException
cmd - The command to sendreply - The expected reply-code
java.io.IOException - if the incorrect response code is received
|
CONGO AppServer | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||