Package org.dlese.dpc.email
Class SendEmail
java.lang.Object
org.dlese.dpc.email.SendEmail
Handles sending emails. See
Javadocs for more information.
- Author:
- John Weatherley
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanSends email to the given address(es).booleanSends email to the given address.voiddoSendEmail(String[] toAddresses, String fromAddress, String msgSubject, String msgBody) Sends email to the given address(es).
-
Constructor Details
-
SendEmail
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 Details
-
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 addressmsgSubject- Email subject linemsgBody- Email content body- Throws:
MessagingException- If error
-
doSend
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 addressmsgSubject- SubjectmsgBody- Message body- Returns:
- True if successful, false otherwise
-
doSend
Sends email to the given address. Does not throw Exception if error but prints error message to System.out.- Parameters:
msgTo- To addressmsgFrom- From addressmsgSubject- SubjectmsgBody- Message body- Returns:
- True if successful, false otherwise
-