public class Mailer extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Mailer.Builder |
| Constructor and Description |
|---|
Mailer(String smtp)
Construct a new Mailer instance to send mail over the given SMTP host.
|
| Modifier and Type | Method and Description |
|---|---|
static Mailer.Builder |
builder(String smtp) |
boolean |
send(Mail mail)
Verifies and sends given Mail argument.
Verification checks whether sufficient information is availabe for sending the given Mail instance. In accordance with RFC 2822, the only required email headers are origination date (section 3.6.1) and from (section 3.6.2). |
public Mailer(String smtp)
smtp - a valid SMTP hostIllegalArgumentException - if smtp is blankpublic static Mailer.Builder builder(String smtp)
smtp - a valid SMTP hostpublic boolean send(Mail mail)
to address.
All other fields are optional.mail - the Mail instance to sendIllegalArgumentException - if the Mail argument is null or invalidIllegalStateException - if neither this Mailer nor the Mail argument have a 'from' email address setCopyright © 2015. All rights reserved.