|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.subethamail.smtp.client.SMTPClient
org.subethamail.smtp.client.SmartClient
public class SmartClient
A somewhat smarter abstraction of an SMTP client which doesn't require knowing anything about the nitty gritty of SMTP.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.subethamail.smtp.client.SMTPClient |
|---|
SMTPClient.Response |
| Constructor Summary | |
|---|---|
SmartClient()
Creates an unconnected client. |
|
SmartClient(String host,
int port,
SocketAddress bindpoint,
String myHost)
Connects to the specified server and issues the initial HELO command. |
|
SmartClient(String host,
int port,
String myHost)
Connects to the specified server and issues the initial HELO command. |
|
| Method Summary | |
|---|---|
void |
connect(String host,
int port)
Connects to the specified server and issues the initial HELO command. |
void |
dataEnd()
Last step after writing data |
void |
dataStart()
Prelude to writing data |
void |
dataWrite(byte[] data,
int numBytes)
Actually write some data |
void |
from(String from)
|
String |
getHeloHost()
Returns the HELO name of this system. |
int |
getRecipientCount()
|
void |
quit()
Quit and close down the connection. |
protected SMTPClient.Response |
receive()
Returns the server response. |
boolean |
sentFrom()
|
boolean |
sentTo()
|
void |
setHeloHost(String myHost)
Sets the domain name or address literal of this system, which name will be sent to the server in the parameter of the HELO and EHLO commands. |
void |
to(String to)
|
| Methods inherited from class org.subethamail.smtp.client.SMTPClient |
|---|
close, createSocket, getBindpoint, getHostPort, receiveAndCheck, send, sendAndCheck, sendReceive, setBindpoint, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SmartClient()
public SmartClient(String host,
int port,
String myHost)
throws UnknownHostException,
IOException,
SMTPException
UnknownHostException - if problem looking up hostname
SMTPException - if problem reported by the server
IOException - if problem communicating with host
public SmartClient(String host,
int port,
SocketAddress bindpoint,
String myHost)
throws UnknownHostException,
IOException,
SMTPException
UnknownHostException - if problem looking up hostname
SMTPException - if problem reported by the server
IOException - if problem communicating with host| Method Detail |
|---|
public void connect(String host,
int port)
throws IOException,
SMTPException
connect in class SMTPClientIOException - if there is a problem connecting to the port
SMTPException
protected SMTPClient.Response receive()
throws IOException
receive in class SMTPClientIOException
public void from(String from)
throws IOException,
SMTPException
IOException
SMTPException
public void to(String to)
throws IOException,
SMTPException
IOException
SMTPException
public void dataStart()
throws IOException,
SMTPException
IOException
SMTPException
public void dataWrite(byte[] data,
int numBytes)
throws IOException
IOException
public void dataEnd()
throws IOException,
SMTPException
IOException
SMTPExceptionpublic void quit()
It still closes the connection, but it does not send the QUIT command if a 421 Service closing transmission channel is received previously. In these cases QUIT would fail anyway.
public boolean sentFrom()
public boolean sentTo()
public int getRecipientCount()
public void setHeloHost(String myHost)
public String getHeloHost()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||