hirondelle.web4j.webmaster
Class EmailerImpl
Object
hirondelle.web4j.webmaster.EmailerImpl
- All Implemented Interfaces:
- Emailer
public final class EmailerImpl
- extends Object
- implements Emailer
Default implementation of Emailer
.
Uses these init-param settings in web.xml:
- Webmaster : the email address of the webmaster.
- MailServerConfig : configuration data to be passed to the mail server, as a list of name=value pairs.
Each name=value pair appears on a single line by itself. Used for mail.host settings, and so on.
The special value NONE indicates that emails are suppressed, and will not be sent.
- MailServerCredentials : user name and password for access to the outgoing mail server.
The user name is separated from the password by a pipe character '|'.
The special value NONE means that no credentials are needed (often the case when the wep app
and the outgoing mail server reside on the same network).
Example web.xml settings, using a Gmail account:
<init-param>
<param-name>Webmaster</param-name>
<param-value>myaccount@gmail.com</param-value>
</init-param>
<init-param>
<param-name>MailServerConfig</param-name>
<param-value>
mail.smtp.host=smtp.gmail.com
mail.smtp.auth=true
mail.smtp.port=465
mail.smtp.socketFactory.port=465
mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
</param-value>
</init-param>
<init-param>
<param-name>MailServerCredentials</param-name>
<param-value>myaccount@gmail.com|mypassword</param-value>
</init-param>
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EmailerImpl
public EmailerImpl()
sendFromWebmaster
public void sendFromWebmaster(List<String> aToAddresses,
String aSubject,
String aBody)
throws AppException
- Description copied from interface:
Emailer
- Send an email from the webmaster to a list of receivers.
- Specified by:
sendFromWebmaster
in interface Emailer
- Parameters:
aToAddresses
- contains email addresses of the receivers, as a List of Strings that satisfy
WebUtil.isValidEmailAddress(String)
aSubject
- satisfies Util.textHasContent(java.lang.String)
aBody
- satisfies Util.textHasContent(java.lang.String)
- Throws:
AppException
Copyright Hirondelle Systems. Published October 19, 2013 - User Guide - All Docs.