Package de.espirit.firstspirit.access
Interface MailService
public interface MailService
Service interface for sending mails via the server.
Use
Use
getService(MailService.class)
to request an instance of this service.- Since:
- 4.0
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
sendMail
(MailHeader mailHeader, String subject, String message, Attachment... attachments) Send a mail using the given configured mail header.void
sendMail
(MailHeader mailHeader, String subject, String message, String subType, boolean synchronous, Attachment... attachments) Send a mail using the given configured mail header and the set type of the message.void
Send a textual mail the set recipient(s), where the message is assumed to be of type "plain".void
sendMail
(String recipient, String subject, String message, Attachment... attachments) Send a mail the set recipient(s), where the message is assumed to be of type "plain".void
Send a textual mail using the given sender name to the set recipient(s), where the message is assumed to be of type "plain".void
sendMail
(String sender, String recipient, String subject, String message, boolean synchronous, Attachment... attachments) Send a mail using the given sender name to the set recipient(s), where the message is assumed to be of type "plain".void
Send a textual mail using the given sender name to the set recipient(s).void
sendMail
(String sender, String recipient, String subject, String message, String subType, boolean synchronous, Attachment... attachments) Send a mail using the given sender name to the set recipient(s).
-
Field Details
-
SUBTYPE_PLAIN
Plain mail type.- Since:
- 4.0
- See Also:
-
SUBTYPE_HTML
HTML mail type.- Since:
- 4.0
- See Also:
-
-
Method Details
-
sendMail
Send a textual mail the set recipient(s), where the message is assumed to be of type "plain". The sender will be the one defined by the server.- Parameters:
recipient
- A semicolon-separated list of recipients.subject
- The subject for the mail.message
- The textual message to be send.- Since:
- 4.0
-
sendMail
Send a textual mail using the given sender name to the set recipient(s), where the message is assumed to be of type "plain".- Parameters:
sender
- The sender of the mail.recipient
- A semicolon-separated list of recipients.subject
- The subject for the mail.message
- The textual message to be send.- Since:
- 4.0
-
sendMail
Send a textual mail using the given sender name to the set recipient(s).- Parameters:
sender
- The sender of the mail.recipient
- A semicolon-separated list of recipients.subject
- The subject for the mail.message
- The textual message to be send.subType
- sub type ("plain" for example)- Since:
- 4.0
-
sendMail
Send a mail the set recipient(s), where the message is assumed to be of type "plain". The sender will be the one defined by the server.- Parameters:
recipient
- A semicolon-separated list of recipients.subject
- The subject for the mail.message
- The textual message to be send.attachments
- Any number of attachments, which base on files or input streams.- Since:
- 4.0
-
sendMail
void sendMail(String sender, String recipient, String subject, String message, boolean synchronous, Attachment... attachments) Send a mail using the given sender name to the set recipient(s), where the message is assumed to be of type "plain".- Parameters:
sender
- The sender of the mail.recipient
- A semicolon-separated list of recipients.subject
- The subject for the mail.message
- The textual message to be send.synchronous
- true, if mail should be send synchronous, and false if should be send in a separated threadattachments
- Any number of attachments, which base on files or- Since:
- 4.0
-
sendMail
void sendMail(String sender, String recipient, String subject, String message, String subType, boolean synchronous, Attachment... attachments) throws SendMailException Send a mail using the given sender name to the set recipient(s).- Parameters:
sender
- The sender of the mail.recipient
- A semicolon-separated list of recipients.subject
- The subject for the mail.message
- The textual message to be send.subType
- The type of message, either "plain" or "html".attachments
- Any number of attachments, which base on files or input streams. @throws SendMailException when sending mail failuresynchronous
- true, if mail should be send synchronous, and false if should be send in a separated thread- Throws:
SendMailException
- if mail could not be sent, cause an error occured- Since:
- 4.0
-
sendMail
void sendMail(MailHeader mailHeader, String subject, String message, Attachment... attachments) throws SendMailException Send a mail using the given configured mail header.- Parameters:
mailHeader
- The configured mail header.subject
- The subject for the mail.message
- The textual message to be send.attachments
- Any number of attachments, which base on files or input streams.- Throws:
SendMailException
- when sending mail failure- Since:
- 4.1.10
-
sendMail
void sendMail(MailHeader mailHeader, String subject, String message, String subType, boolean synchronous, Attachment... attachments) throws SendMailException Send a mail using the given configured mail header and the set type of the message.- Parameters:
mailHeader
- The configured mail header.subject
- The subject for the mail.message
- The textual message to be send.subType
- The type of message, either "plain" or "html".attachments
- Any number of attachments, which base on files or input streams. @throws SendMailException when sending mail failure- Throws:
SendMailException
- Since:
- 4.1.10
-