public class SmartClient extends SMTPClient
SMTPClient.Response| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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) |
close, createSocket, getBindpoint, getHostPort, receiveAndCheck, send, sendAndCheck, sendReceive, setBindpoint, toStringpublic SmartClient()
public SmartClient(String host, int port, String myHost) throws UnknownHostException, IOException, SMTPException
UnknownHostException - if problem looking up hostnameSMTPException - if problem reported by the serverIOException - if problem communicating with hostpublic SmartClient(String host, int port, SocketAddress bindpoint, String myHost) throws UnknownHostException, IOException, SMTPException
UnknownHostException - if problem looking up hostnameSMTPException - if problem reported by the serverIOException - if problem communicating with hostpublic void connect(String host, int port) throws IOException, SMTPException
connect in class SMTPClientIOException - if there is a problem connecting to the portSMTPExceptionprotected SMTPClient.Response receive() throws IOException
receive in class SMTPClientIOExceptionpublic void from(String from) throws IOException, SMTPException
IOExceptionSMTPExceptionpublic void to(String to) throws IOException, SMTPException
IOExceptionSMTPExceptionpublic void dataStart()
throws IOException,
SMTPException
IOExceptionSMTPExceptionpublic void dataWrite(byte[] data,
int numBytes)
throws IOException
IOExceptionpublic void dataEnd()
throws IOException,
SMTPException
IOExceptionSMTPExceptionpublic 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()
Copyright © 2006–2021. All rights reserved.