public interface MailSender
Modifier and Type | Method and Description |
---|---|
MailSender |
addPart(byte[] bytes)
Adds a bytes part to the this mail sender.
|
MailSender |
addPart(byte[] bytes,
String type)
Adds a bytes part with type to this mail sender.
|
MailSender |
addPart(byte[] bytes,
String type,
String name)
Adds a bytes part with type and name to this mail sender.
|
MailSender |
addPart(File file)
Adds a file part to this mail sender.
|
MailSender |
addPart(File file,
String type)
Adds a file part with type to this mail sender.
|
MailSender |
addRecipients(String... recipients)
Adds a list of recipient mail addresses to this mail sender.
|
void |
clear()
Clears the state of this mail sender and releases internal resources.
|
void |
send()
Builds the mail message and sends it to the specified recipients.
|
MailSender |
setMessage(String message)
Sets the message body of this mail sender.
|
MailSender |
setSubject(String subject)
Sets the message subject of this mail sender.
|
void clear()
MailSender addRecipients(String... recipients) throws Exception
recipients
- list of recipient mail addresses to add.IllegalArgumentException
- if a mail address is invalid.Exception
- if an unexpected error occurs.MailSender setSubject(String subject) throws Exception
subject
- the message subject of this mail sender.NullPointerException
- if subject
is null
.IllegalArgumentException
- if subject
is invalid.Exception
- if an unexpected error occurs.MailSender setMessage(String message) throws Exception
message
- the message body of this mail sender.NullPointerException
- if message
is null
.IllegalArgumentException
- if message
is invalid.Exception
- if an unexpected error occurs.MailSender addPart(File file) throws Exception
file
- the file part to add to this mail sender.NullPointerException
- if file
is null
.IllegalArgumentException
- if file
is invalid.Exception
- if an unexpected error occurs.MailSender addPart(File file, String type) throws Exception
file
- the file part to add to this mail sender.type
- the content type of the supplied file
.NullPointerException
- if an argument is null
.IllegalArgumentException
- if an argument is invalid.Exception
- if an unexpected error occurs.MailSender addPart(byte[] bytes) throws Exception
bytes
- the bytes part to add to this mail sender.NullPointerException
- if bytes
is null
.IllegalArgumentException
- if bytes
is invalid.Exception
- if an unexpected error occurs.MailSender addPart(byte[] bytes, String type) throws Exception
bytes
- the bytes part to add to this mail sender.type
- the content type of the supplied bytes
.NullPointerException
- if an argument is null
.IllegalArgumentException
- if an argument is invalid.Exception
- if an unexpected error occurs.MailSender addPart(byte[] bytes, String type, String name) throws Exception
bytes
- the bytes part to add to this mail sender.type
- the content type of the supplied bytes
.name
- the optional name of the supplied bytes
.NullPointerException
- if an argument is null
.IllegalArgumentException
- if an argument is invalid.Exception
- if an unexpected error occurs.Copyright © OBCOM INGENIERIA S.A. (Chile). All Rights Reserved.