com.ibm.tspaces.examples.services
Class SMTPMailer

java.lang.Object
  |
  +--com.ibm.tspaces.examples.services.SMTPMailer

public class SMTPMailer
extends java.lang.Object


Constructor Summary
SMTPMailer(java.lang.String host)
          Constructor that takes the name of the host that supports SMTP Port 25.
 
Method Summary
static void main(java.lang.String[] args)
          Just for unit testing
 void send()
          This will cause the Message to be sent to one or more recipients While it was parsing the headers, it built a list of email addresses.
 void setContent(java.lang.String text)
          SetContent supplies the text of the email message There is plenty pof room for improvement here.
 void setHeader(java.lang.String[] headers)
          SetHeader takes a an array of header lines and extracts each one and sends it to the above setHeader method
 void setHeader(java.lang.String type, java.lang.String text)
          SetHeader takes a single header line and extracts certain information and adds it to the Mail message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SMTPMailer

public SMTPMailer(java.lang.String host)
Constructor that takes the name of the host that supports SMTP Port 25.
Method Detail

setHeader

public void setHeader(java.lang.String type,
                      java.lang.String text)
SetHeader takes a single header line and extracts certain information and adds it to the Mail message

setHeader

public void setHeader(java.lang.String[] headers)
SetHeader takes a an array of header lines and extracts each one and sends it to the above setHeader method

setContent

public void setContent(java.lang.String text)
SetContent supplies the text of the email message There is plenty pof room for improvement here. we could support attachments etc.

send

public void send()
This will cause the Message to be sent to one or more recipients While it was parsing the headers, it built a list of email addresses. It will now invoke sendTo for each one.

main

public static void main(java.lang.String[] args)
Just for unit testing