public interface EmailSender
Modifier and Type | Method and Description |
---|---|
boolean |
canEmail(String address)
Can the address receive messages from us?
|
boolean |
isEnabled() |
void |
send(Address from,
Collection<Address> rcpt,
Map<String,EmailHeader> headers,
String body)
Sends an email message with a text body only (i.e.
|
default void |
send(Address from,
Collection<Address> rcpt,
Map<String,EmailHeader> headers,
String textBody,
String htmlBody)
Sends an email message.
|
boolean isEnabled()
boolean canEmail(String address)
address
- the address to consider.default void send(Address from, Collection<Address> rcpt, Map<String,EmailHeader> headers, String textBody, String htmlBody) throws EmailException
send
should construct
a multipart/alternative
message with an appropriately-selected boundary.from
- who the message is from.rcpt
- one or more address where the message will be delivered to. This list overrides any
To or CC headers in headers
.headers
- message headers.textBody
- text to appear in the text/plain
body of the message.htmlBody
- optional HTML code to appear in the text/html
body of the message.EmailException
- the message cannot be sent.void send(Address from, Collection<Address> rcpt, Map<String,EmailHeader> headers, String body) throws EmailException
Authors of new implementations of this interface should not use this method to send a
message because this method does not accept the HTML body. Instead, authors should use the
above signature of send
.
This version of the method is preserved for support of legacy implementations.
from
- who the message is from.rcpt
- one or more address where the message will be delivered to. This list overrides any
To or CC headers in headers
.headers
- message headers.body
- text to appear in the body of the message.EmailException
- the message cannot be sent.