Class MailClient

java.lang.Object
  extended by MailClient

public class MailClient
extends java.lang.Object

A class to model a simple email client. The client is run by a particular user, and sends and retrieves mail via a particular server.

Version:
2005.07.06
Author:
David J. Barnes and Michael Kolling

Constructor Summary
MailClient(MailServer server, java.lang.String user)
          Create a mail client run by user and attached to the given server.
 
Method Summary
 MailItem getNextMailItem()
          Return the next mail item (if any) for this user.
 void printNextMailItem()
          Print the next mail item (if any) for this user to the text terminal.
 void sendMessage(java.lang.String to, java.lang.String message)
          Send the given message to the given recipient via the attached mail server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailClient

public MailClient(MailServer server,
                  java.lang.String user)
Create a mail client run by user and attached to the given server.

Method Detail

getNextMailItem

public MailItem getNextMailItem()
Return the next mail item (if any) for this user.


printNextMailItem

public void printNextMailItem()
Print the next mail item (if any) for this user to the text terminal.


sendMessage

public void sendMessage(java.lang.String to,
                        java.lang.String message)
Send the given message to the given recipient via the attached mail server.

Parameters:
to - The intended recipient.
mess - A fully prepared message to be sent.