businesslogic
Class MailMessage

java.lang.Object
  |
  +--businesslogic.MailMessage

public class MailMessage
extends java.lang.Object
implements Testable

MailMessage provides an encapsulated means of constructing and sending an internet mail message without having to understand SMTP.


Constructor Summary
MailMessage()
          Default constructor; initializes message information and retrieves mail host information from application configuration properties.
 
Method Summary
 void send()
          Mails the message to the recipient(s) by way of the SMTP host specified by the smtphost value in the application properties
 void setMessage(java.lang.String text)
          accessor method
 void setRecipient(java.lang.String rcpt)
          accessor method
 boolean TestUnit()
          Support method for Testable interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailMessage

public MailMessage()
Default constructor; initializes message information and retrieves mail host information from application configuration properties.
Method Detail

setMessage

public void setMessage(java.lang.String text)
accessor method

setRecipient

public void setRecipient(java.lang.String rcpt)
accessor method
Parameters:
rcpt - a single or delimited list of mail recipients. mail addresses can be delimited with spaces semicolons or commas

send

public void send()
          throws java.io.IOException,
                 java.net.UnknownHostException
Mails the message to the recipient(s) by way of the SMTP host specified by the smtphost value in the application properties
Throws:
java.io.IOException - thrown if there are transmission errors
java.net.UnknownHostException - thrown if the host cannot be found

TestUnit

public boolean TestUnit()
Support method for Testable interface. Allows unit to be exercised under the apputil.TestHarness class
Specified by:
TestUnit in interface Testable