Package org.europa.together.domain
Class Mail
java.lang.Object
org.europa.together.domain.Mail
Compose E-Mail.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addAttachment
(String resource) Add an attachment to the attachment list.void
addAttachmentList
(List<String> attachments) Add attachments from a list of Strings (resource path).boolean
addRecipent
(String recipient) Add an recipient to the recipient l.The implementation check if the recipient already exist in the list.Also the format of an valid e-mail address will be tested.void
addRecipientList
(List<String> recipients) Add recipients from a List of Strings (E-Mail Address).void
Reset the attachment list.void
Reset the Recipient List.List<jakarta.activation.FileDataSource>
Return the whole list of attachments - FileDataSource.long
Get the limitation for the filesize of attachments.Get the content of a message.Get the MimeTYpe of the E-Mail.List<jakarta.mail.internet.InternetAddress>
Get the whole list of recipients - InternetAdress.Get the subject of a e-mail.void
setAttachmentSize
(long attachmentSize) Set a limiter to the filesize for attachments.void
setMessage
(String message) Add e-mail content from a String.void
Set the MimeType of a E-Mail to HTML.void
Set the MimeType of an E-Mail to plain text.void
setSubject
(String subject) Add a subject (topic) to the mail.
-
Constructor Details
-
Mail
public Mail()
-
-
Method Details
-
addRecipientList
Add recipients from a List of Strings (E-Mail Address).- Parameters:
recipients
- as List.- Throws:
jakarta.mail.internet.AddressException
-
addAttachmentList
Add attachments from a list of Strings (resource path).- Parameters:
attachments
- as List
-
getAttachmentList
Return the whole list of attachments - FileDataSource.- Returns:
- attachments as List
-
addAttachment
Add an attachment to the attachment list. The file size of attachments can be limited. To refer an attachment, set the resource e.g.: picture.png- Parameters:
resource
- as String- Returns:
- true on success
-
clearAttachments
public void clearAttachments()Reset the attachment list. -
getRecipentList
Get the whole list of recipients - InternetAdress.- Returns:
- recipients as List
-
addRecipent
Add an recipient to the recipient l.The implementation check if the recipient already exist in the list.Also the format of an valid e-mail address will be tested. If an given e-mail address is not valid it will not added to the list.- Parameters:
recipient
- as String- Returns:
- true on success
- Throws:
jakarta.mail.internet.AddressException
-
clearRecipents
public void clearRecipents()Reset the Recipient List. -
setMimeTypeToHTML
public void setMimeTypeToHTML()Set the MimeType of a E-Mail to HTML. -
setMimeTypeToText
public void setMimeTypeToText()Set the MimeType of an E-Mail to plain text. -
getMimeType
Get the MimeTYpe of the E-Mail.- Returns:
- mimeType as String
-
getSubject
Get the subject of a e-mail.- Returns:
- subject as String
-
setSubject
Add a subject (topic) to the mail.- Parameters:
subject
- as String
-
getMessage
Get the content of a message.- Returns:
- content as String
-
setMessage
Add e-mail content from a String.- Parameters:
message
- as String
-
getAttachmentSize
public long getAttachmentSize()Get the limitation for the filesize of attachments. 0 = unlimited.- Returns:
- attachmentSize as long
-
setAttachmentSize
public void setAttachmentSize(long attachmentSize) Set a limiter to the filesize for attachments. Default = 0, unlimited.- Parameters:
attachmentSize
- as long
-