Class SmtpClient
java.lang.Object
netscape.net.NetworkClient
netscape.net.TransferProtocolClient
netscape.net.smtp.SmtpClient
This class implements the SMTP client.
You can send a piece of mail by creating a new SmtpClient, calling
the "to" method to add destinations, calling "from" to name the
sender, calling startMessage to return a stream to which you write
the message (with RFC733 headers) and then you finally close the Smtp
Client.
- Version:
- 1.17, 12 Dec 1994
- Author:
- James Gosling
-
Field Summary
Fields inherited from class TransferProtocolClient
lastReplyCode, serverResponseModifier and TypeFieldDescriptionprotected intcode for last replyArray of strings (usually 1 entry) for the last reply from the server.Fields inherited from class NetworkClient
serverInput, serverOutput, serverSocketModifier and TypeFieldDescriptionBuffered stream for reading replies from server.Stream for printing to the server.protected SocketSocket for communicating with server. -
Constructor Summary
ConstructorsConstructorDescriptionCreate an uninitialized SMTP client.SmtpClient(String host) New SMTP client connected to host host. -
Method Summary
Modifier and TypeMethodDescriptionvoidissue the QUIT command to the SMTP server and close the connection.voidvoidMethods inherited from class TransferProtocolClient
getResponseString, getResponseStrings, readServerResponse, sendServerModifier and TypeMethodDescriptionconverts the server response into a string.Returns all server response strings.intPulls the response from the server and returns the code as a number.voidsendServer(String cmd) Sends command cmd to the server.Methods inherited from class NetworkClient
doConnect, openServer, serverIsOpenModifier and TypeMethodDescriptionprotected SocketReturn a socket connected to the server, with any appropriate options pre-establishedvoidopenServer(String server, int port) Open a connection to the server.booleanReturn server connection status
-
Constructor Details
-
SmtpClient
New SMTP client connected to host host.- Throws:
IOException
-
SmtpClient
-
-
Method Details
-
closeServer
issue the QUIT command to the SMTP server and close the connection.- Overrides:
closeServerin classNetworkClient- Throws:
IOException
-
to
- Throws:
IOException
-
from
- Throws:
IOException
-
startMessage
- Throws:
IOException
-