Class Mail

java.lang.Object
org.europa.together.domain.Mail

public class Mail extends Object
Compose E-Mail.
  • Constructor Details

    • Mail

      public Mail()
  • Method Details

    • addRecipientList

      public void addRecipientList(List<String> recipients) throws jakarta.mail.internet.AddressException
      Add recipients from a List of Strings (E-Mail Address).
      Parameters:
      recipients - as List.
      Throws:
      jakarta.mail.internet.AddressException
    • addAttachmentList

      public void addAttachmentList(List<String> attachments)
      Add attachments from a list of Strings (resource path).
      Parameters:
      attachments - as List
    • getAttachmentList

      public List<jakarta.activation.FileDataSource> getAttachmentList()
      Return the whole list of attachments - FileDataSource.
      Returns:
      attachments as List
    • addAttachment

      public boolean addAttachment(String resource)
      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

      public List<jakarta.mail.internet.InternetAddress> getRecipentList()
      Get the whole list of recipients - InternetAdress.
      Returns:
      recipients as List
    • addRecipent

      public boolean addRecipent(String recipient) throws jakarta.mail.internet.AddressException
      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

      public String getMimeType()
      Get the MimeTYpe of the E-Mail.
      Returns:
      mimeType as String
    • getSubject

      public String getSubject()
      Get the subject of a e-mail.
      Returns:
      subject as String
    • setSubject

      public void setSubject(String subject)
      Add a subject (topic) to the mail.
      Parameters:
      subject - as String
    • getMessage

      public String getMessage()
      Get the content of a message.
      Returns:
      content as String
    • setMessage

      public void setMessage(String message)
      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