|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.cafesoft.core.smtp.SmtpClient
This class implements a simple SMTP (Simple Mail Transfer Protocol) client. Using a TCP/IP Socket, this class connects to an SMTP server and provides facilities for sending email to the server.
| Constructor Summary | |
SmtpClient(String hostName)
Create a new SmtpClient for connecting to the specified host. |
|
SmtpClient(String hostName,
boolean flag)
Create a new SmtpClient for connecting to the specified host. |
|
| Method Summary | |
void |
closeServer()
Close the connection with the SMTP Server. |
void |
from(String from)
Set the message sender. |
PrintStream |
startMessage()
Start the body of the email message. |
void |
to(String to)
Set the message recipient. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SmtpClient(String hostName)
throws UnknownHostException,
IOException
hostName - the name of the SMTP host.
public SmtpClient(String hostName,
boolean flag)
throws UnknownHostException,
IOException
hostName - the name of the SMTP host.flag - if true, then interactions with the SMTP server are
printed to stdout.| Method Detail |
public void from(String from)
throws IOException
from - the email address of the message sender.
IOException - if trouble communicating with the SMTP server.
public void to(String to)
throws IOException,
UnknownUserException
to - username(s) of the message recipient(s). If more than one
recipient at this host, names should be separated by commas
and/or spaces.
IOException - if trouble communicating with the SMTP server.
UnknownUserException
public PrintStream startMessage()
throws IOException
IOException - if trouble communicating with the SMTP server.
public void closeServer()
throws IOException
IOException - if trouble communicating with the SMTP server.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||