public class CommonsEmailModule extends Object implements Extension
Small but helpful module that provides access to Email instances via
the service registry and Config.
mail.hostName = smtp.googlemail.com mail.ssl.onConnect = true mail.username = username mail.password = password mail.from = user@gmail.com mail.subject = TestMail
{
install(new CommonsEmailModule());
get("/send", ctx -> {
require(SimpleEmail.class)
.setMsg("you got an email!")
.setTo("foo@bar.com")
.send();
});
}
That's all it does! Every time you require an email, it creates one and setup properties from
mail.*.
| Constructor and Description |
|---|
CommonsEmailModule()
Creates a
CommonsEmailModule. |
CommonsEmailModule(String name)
Creates a
CommonsEmailModule. |
public CommonsEmailModule(String name)
CommonsEmailModule.name - Name of the property who has the mail information. Default is: mail.*.public CommonsEmailModule()
CommonsEmailModule.Copyright © 2022. All rights reserved.