Class com.tdac.mail.SMTPConnection
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.tdac.mail.SMTPConnection

java.lang.Object
   |
   +----com.tdac.mail.SocketConnection
           |
           +----com.tdac.mail.SMTPConnection

public class SMTPConnection
extends SocketConnection
This class is used to connect to an SMTP server to send mail
Version:
1.0, 11/19/96
Author:
Timothy D. A. Cox

Constructor Index

 o SMTPConnection()

Method Index

 o connect(String)
Connect to a server on port 25 (SMTP).
 o login(String, String)
noop
 o logout()
noop
 o sendMessage(String, String, String, String, String)
Send a message thru an SMTP server by issuing a 'HELO' command

Constructors

 o SMTPConnection
  public SMTPConnection()

Methods

 o connect
  public synchronized String connect(String server) throws ExceptionMailConnection
Connect to a server on port 25 (SMTP). Will setup the private stream objects and read the mail server greeting.
Parameters:
server - the mail server name (eg. mail.domain.com)
Returns:
the mail server greeting string
 o sendMessage
  public void sendMessage(String hostname,
                          String mailTo,
                          String from,
                          String subject,
                          String data) throws InternalException
Send a message thru an SMTP server by issuing a 'HELO' command
Parameters:
hostname - the SMTP server name
mailTo - the userid to recieve the mail
from - the userid of the sender
subject - message subject
data - message contents
 o login
  public void login(String userid,
                    String password) throws ExceptionMailConnection
noop
 o logout
  public void logout() throws ExceptionMailConnection
noop

All Packages  Class Hierarchy  This Package  Previous  Next  Index