amber.utility
Class MailSystem

java.lang.Object
  |
  +--amber.utility.MailSystem

public class MailSystem
extends java.lang.Object

This class is a simple mail system which eases the complexities of interfacing with the Java Mail API.

Version:
1.0.0
Author:
Dr. David J. Knowles.

Field Summary
static java.lang.String DefaultFrom
           
static java.lang.String HtmlTextType
           
static java.lang.String PlainTextType
          Type of mail which can be sent.
static java.lang.String PropertiesFile
          The mail properties file name.
static java.lang.String SmtpServer
          Mail property.
 
Constructor Summary
MailSystem()
          Default constructor.
 
Method Summary
 void sendEmail(java.lang.String to, java.lang.String subject, java.lang.String body, java.lang.String type)
          Sends a piece of text mail to the specified recipient.
static void sendEmail(java.lang.String to, java.lang.String from, java.lang.String subject, java.lang.String body, java.lang.String smtpServer)
          Sends a piece of text mail to the specified recipient.
static void sendEmail(java.lang.String to, java.lang.String from, java.lang.String subject, java.lang.String body, java.lang.String smtpServer, java.lang.String type)
          Sends a piece of text mail to the specified recipient.
static void setUpHtml(java.lang.String body, amber.utility.Message msg, java.lang.String type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SmtpServer

public static final java.lang.String SmtpServer
Mail property.

DefaultFrom

public static final java.lang.String DefaultFrom

PropertiesFile

public static final java.lang.String PropertiesFile
The mail properties file name.

PlainTextType

public static final java.lang.String PlainTextType
Type of mail which can be sent.

HtmlTextType

public static final java.lang.String HtmlTextType
Constructor Detail

MailSystem

public MailSystem()
           throws AmberMessagingException
Default constructor.
Method Detail

sendEmail

public void sendEmail(java.lang.String to,
                      java.lang.String subject,
                      java.lang.String body,
                      java.lang.String type)
               throws AmberMessagingException
Sends a piece of text mail to the specified recipient.
Parameters:
to - String containing the e-mail address to send to.
subject - String containing the subject of the e-mail message.
body - String containing the body (content) of the e-mail message.
type - String containing the MIME type for the e-mail message.

sendEmail

public static void sendEmail(java.lang.String to,
                             java.lang.String from,
                             java.lang.String subject,
                             java.lang.String body,
                             java.lang.String smtpServer,
                             java.lang.String type)
                      throws AmberMessagingException
Sends a piece of text mail to the specified recipient.
Parameters:
to - String containing the e-mail address to send to.
from - String containing the e-mail address of the person who sent the mail.
subject - String containing the subject of the e-mail message.
body - String containing the body (content) of the e-mail message.
smtpServer - String containing the address of the SMTP server to send to.
type - String containing the MIME type for the e-mail message.

setUpHtml

public static void setUpHtml(java.lang.String body,
                             amber.utility.Message msg,
                             java.lang.String type)
                      throws AmberMessagingException,
                             java.io.IOException

sendEmail

public static void sendEmail(java.lang.String to,
                             java.lang.String from,
                             java.lang.String subject,
                             java.lang.String body,
                             java.lang.String smtpServer)
                      throws AmberMessagingException
Sends a piece of text mail to the specified recipient. Defaults to sending the message as MIME type text/plain.
Parameters:
to - String containing the e-mail address to send to.
from - String containing the e-mail address of the person who sent the mail.
subject - String containing the subject of the e-mail message.
body - String containing the body (content) of the e-mail message.
smtpServer - String containing the address of the SMTP server to send to.


Copyright © 2002 Clearfield Research Ltd. All Rights Reserved.