org.optimizationservices.oscommon.util
Class MailUtil

java.lang.Object
  extended by org.optimizationservices.oscommon.util.MailUtil

public class MailUtil
extends java.lang.Object

The MailUtil class contains methods for performing common basic EMail related operations used by various classes in the Optimization Services (OS) framework.

Since:
OS1.0
Version:
1.0, 03/14/2004
Author:
Robert Fourer, Jun Ma, Kipp Martin

Constructor Summary
MailUtil()
           
 
Method Summary
static void main(java.lang.String[] args)
          main for test purposes.
static boolean send(java.lang.String fromEmail, java.lang.String toEmail, java.lang.String ccEmail, java.lang.String bccEmail, java.lang.String subject, java.lang.String message, java.lang.String attachedFiles)
          send an email.
static void sendInThread(java.lang.String fromEmail, java.lang.String toEmail, java.lang.String ccEmail, java.lang.String bccEmail, java.lang.String subject, java.lang.String message, java.lang.String attachedFiles)
          send an email in a thread so that there is no wait time.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailUtil

public MailUtil()
Method Detail

send

public static boolean send(java.lang.String fromEmail,
                           java.lang.String toEmail,
                           java.lang.String ccEmail,
                           java.lang.String bccEmail,
                           java.lang.String subject,
                           java.lang.String message,
                           java.lang.String attachedFiles)
send an email.

Parameters:
fromEmail - holds the from email address to send the email; uses default from email if null.
toEmail - holds the to email address to send the email; uses default to email if null. Use comma (,), semicolon (;) or space to delimit if sending to multiple addresses
ccEmail - holds the cc (carbon copy) email address to send the email, no cc email if null. Use comma (,), semicolon (;) or space to delimit if cc sending to multiple addresses.
bccEmail - holds the bcc (blind carbon copy) email address to send the email; no bcc email if null. Use comma (,), semicolon (;) or space to delimit if bcc sending to multiple addresses.
subject - holds the email subject; uses default suject if null.
message - holds the email message body; uses default message if null.
attachedFiles - holds an array of the file names (w/ full paths) to be attached; no file attached if null. Use comma (,), semicolon (;) or space to delimit if multiple file names.
Returns:
whether the mail is sent successfully or not.

sendInThread

public static void sendInThread(java.lang.String fromEmail,
                                java.lang.String toEmail,
                                java.lang.String ccEmail,
                                java.lang.String bccEmail,
                                java.lang.String subject,
                                java.lang.String message,
                                java.lang.String attachedFiles)
send an email in a thread so that there is no wait time.

Parameters:
fromEmail - holds the from email address to send the email; uses default from email if null.
toEmail - holds the to email address to send the email; uses default to email if null. Use comma (,), semicolon (;) or space to delimit if sending to multiple addresses
ccEmail - holds the cc (carbon copy) email address to send the email, no cc email if null. Use comma (,), semicolon (;) or space to delimit if cc sending to multiple addresses.
bccEmail - holds the bcc (blind carbon copy) email address to send the email; no bcc email if null. Use comma (,), semicolon (;) or space to delimit if bcc sending to multiple addresses.
subject - holds the email subject; uses default suject if null.
message - holds the email message body; uses default message if null.
attachedFiles - holds an array of the file names (w/ full paths) to be attached; no file attached if null. Use comma (,), semicolon (;) or space to delimit if multiple file names.

main

public static void main(java.lang.String[] args)
main for test purposes.

Parameters:
argv - command line arguments.