Class Mailer
java.lang.Object
org.deltava.mail.Mailer
A utility class to send e-mail messages.
- Since:
- 1.0
- Version:
- 11.1
- Author:
- Luke
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
send
(Collection<? extends EMailAddress> addrs) Adds a group of addresses to the recipient list, and sends the message in a new thread.void
send
(EMailAddress addr) Adds an individual address to the recipient list, and sends the message in a new thread.void
setAttachment
(javax.activation.DataSource ds) Attaches a file to the message.void
setCC
(EMailAddress addr) Adds an individual to the CC list of this message.void
setContext
(MessageContext ctx) Sets the messaging context used to generate e-mail messages.
-
Constructor Details
-
Mailer
Initializes the mailer with a source address.- Parameters:
from
- the source address
-
-
Method Details
-
setAttachment
public void setAttachment(javax.activation.DataSource ds) Attaches a file to the message.- Parameters:
ds
- a DataSource pointing to the file attachment data.
-
setContext
Sets the messaging context used to generate e-mail messages.- Parameters:
ctx
- the messaging context
-
send
Adds an individual address to the recipient list, and sends the message in a new thread.- Parameters:
addr
- the recipient name/address
-
setCC
Adds an individual to the CC list of this message.- Parameters:
addr
- the recipient name/address
-
send
Adds a group of addresses to the recipient list, and sends the message in a new thread.- Parameters:
addrs
- a Collection of recipient names/addresses
-