Package netscape.net.smtp
Class SmtpClient
- java.lang.Object
-
- netscape.net.NetworkClient
-
- netscape.net.TransferProtocolClient
-
- netscape.net.smtp.SmtpClient
-
public class SmtpClient extends TransferProtocolClient
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 netscape.net.TransferProtocolClient
lastReplyCode, serverResponse
-
Fields inherited from class netscape.net.NetworkClient
serverInput, serverOutput, serverSocket
-
-
Constructor Summary
Constructors Constructor Description SmtpClient()
Create an uninitialized SMTP client.SmtpClient(java.lang.String host)
New SMTP client connected to host host.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeServer()
issue the QUIT command to the SMTP server and close the connection.void
from(java.lang.String s)
java.io.PrintStream
startMessage()
void
to(java.lang.String s)
-
Methods inherited from class netscape.net.TransferProtocolClient
getResponseString, getResponseStrings, readServerResponse, sendServer
-
Methods inherited from class netscape.net.NetworkClient
doConnect, openServer, serverIsOpen
-
-
-
-
Method Detail
-
closeServer
public void closeServer() throws java.io.IOException
issue the QUIT command to the SMTP server and close the connection.- Overrides:
closeServer
in classNetworkClient
- Throws:
java.io.IOException
-
to
public void to(java.lang.String s) throws java.io.IOException
- Throws:
java.io.IOException
-
from
public void from(java.lang.String s) throws java.io.IOException
- Throws:
java.io.IOException
-
startMessage
public java.io.PrintStream startMessage() throws java.io.IOException
- Throws:
java.io.IOException
-
-