import java.util.Hashtable;
import java.io.Writer;

/**
 * This is just a collection of data that makes up a mail message.
 * @author Al Williams
 * @version 1.0
 * @see SMTP#sendMail
 */
public class MailMessage
{
    /**
     * Default constructor.
     * @param None
     */
    public MailMessage()
    {
    }
    /**
     * Constructor that initializes. 
     * @param _from The sender's e-mail address.
     * @param _to The recipient's e-mail address (separate multiple addresses with semicolons).
     * @param _cc Carbon copy addresses (separate multiple addresses with semicolons).
     * @param _bcc Blind copy addresses (separate multiple addresses with semicolons).
     * @param _subject The e-mail subject.
     * @param _body The body of the e-mail.
     */
    public MailMessage( String _from, String _to,
    String _cc, String _bcc, String _subject, String _body )
    {
        sender = _from;
        to = _to;
        cc = _cc;
        bcc = _bcc;
        subject = _subject;
        body = _body;
    }
    /**
     * Constructor with commonly required arguments.
     * @param _from The sender's e-mail address.
     * @param _to The recipient's e-mail address (separate multiple addresses with semicolons).
     * @param _subject The e-mail subject.
     * @Param _body The body of the e-mail.
     */
    public MailMessage( String _from, String _to, String _subject, String _body )
    {
        sender = _from;
        to = _to;
        subject = _subject;
        body = _body;
    }
    /**
     * The sender's e-mail address.
     */
    public String sender;
    /**
     * The recipient's e-mail address (separate multiple addresses with semicolons).
     */
    public String to;
    /**
     * The Carbon Copy addresses (separate multiple addresses with semicolons).
     */
    public String cc;
    /**
     * The Blind Carbon Copy addresses (separate multiple addresses with semicolons).
     */
    public String bcc;
    /**
     * The e-mail's subject.
     */
    public String subject;
    /**
     * The e-mail's body.
     */
    public String body;
    /**
     * Extra headers
     */
    public Class encoder=null;
    public Hashtable headers=null;
    public void addHeader(String header,String value) {
	if (headers==null) headers=new Hashtable();
	headers.put(header,value);
    }
}

