DLESE Tools
v1.6.0

org.dlese.dpc.email
Class SendEmail

java.lang.Object
  extended by org.dlese.dpc.email.SendEmail

public class SendEmail
extends Object

Handles sending emails. See Javadocs for more information.

Author:
John Weatherley

Constructor Summary
SendEmail(String MAIL_TYPE, String MAIL_SERVER)
          Constructor for the SendEmail object
 
Method Summary
 boolean doSend(String[] msgTo, String msgFrom, String msgSubject, String msgBody)
          Sends email to the given address(es).
 boolean doSend(String msgTo, String msgFrom, String msgSubject, String msgBody)
          Sends email to the given address.
 void doSendEmail(String[] toAddresses, String fromAddress, String msgSubject, String msgBody)
          Sends email to the given address(es).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SendEmail

public SendEmail(String MAIL_TYPE,
                 String MAIL_SERVER)
Constructor for the SendEmail object

Parameters:
MAIL_TYPE - The mail type, for example 'mail.smtp.host'
MAIL_SERVER - The mail server, for example 'localhost', 'my-mail-server'
Method Detail

doSendEmail

public void doSendEmail(String[] toAddresses,
                        String fromAddress,
                        String msgSubject,
                        String msgBody)
                 throws MessagingException
Sends email to the given address(es).

Parameters:
toAddresses - To address(es)
fromAddress - From address
msgSubject - Email subject line
msgBody - Email content body
Throws:
MessagingException - If error

doSend

public boolean doSend(String[] msgTo,
                      String msgFrom,
                      String msgSubject,
                      String msgBody)
Sends email to the given address(es). Does not throw Exception if error but prints error message to System.out.

Parameters:
msgTo - To address(es)
msgFrom - From address
msgSubject - Subject
msgBody - Message body
Returns:
True if successful, false otherwise

doSend

public boolean doSend(String msgTo,
                      String msgFrom,
                      String msgSubject,
                      String msgBody)
Sends email to the given address. Does not throw Exception if error but prints error message to System.out.

Parameters:
msgTo - To address
msgFrom - From address
msgSubject - Subject
msgBody - Message body
Returns:
True if successful, false otherwise

DLESE Tools
v1.6.0