public class

SmtpClient

extends TransferProtocolClient
java.lang.Object
   ↳ sun.net.NetworkClient
     ↳ sun.net.TransferProtocolClient
       ↳ sun.net.smtp.SmtpClient

Class Overview

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.

Summary

[Expand]
Inherited Fields
From class sun.net.TransferProtocolClient
From class sun.net.NetworkClient
Public Constructors
SmtpClient(String host)
New SMTP client connected to host host.
SmtpClient()
Create an uninitialized SMTP client.
SmtpClient(int to)
Public Methods
void closeServer()
issue the QUIT command to the SMTP server and close the connection.
void from(String s)
String getMailHost()
PrintStream startMessage()
void to(String s)
[Expand]
Inherited Methods
From class sun.net.TransferProtocolClient
From class sun.net.NetworkClient
From class java.lang.Object

Public Constructors

public SmtpClient (String host)

New SMTP client connected to host host.

Throws
IOException

public SmtpClient ()

Create an uninitialized SMTP client.

Throws
IOException

public SmtpClient (int to)

Throws
IOException

Public Methods

public void closeServer ()

issue the QUIT command to the SMTP server and close the connection.

Throws
IOException

public void from (String s)

Throws
IOException

public String getMailHost ()

public PrintStream startMessage ()

Throws
IOException

public void to (String s)

Throws
IOException