Class Mail

java.lang.Object
dev.voidframework.sendmail.entity.Mail

public final class Mail extends Object
A single mail.
Since:
1.7.0
  • Constructor Details

    • Mail

      public Mail()
      Build a new instance.
      Since:
      1.7.0
  • Method Details

    • getCharset

      public Charset getCharset()
      Gets the defined charset.
      Returns:
      The charset defined in this mail
      Since:
      1.7.0
    • setCharset

      public void setCharset(Charset charset)
      Sets the mail charset.
      Parameters:
      charset - The charset defined in this mail
      Since:
      1.7.0
    • getSubject

      public String getSubject()
      Gets the subject.
      Returns:
      The subject of this mail
      Since:
      1.7.0
    • setSubject

      public void setSubject(String subject)
      Sets the subject.
      Parameters:
      subject - The subject to set
      Since:
      1.7.0
    • getBodyContentHtml

      public String getBodyContentHtml()
      Gets the HTML body content.
      Returns:
      The HTML body content
      Since:
      1.7.0
    • setBodyContentHtml

      public void setBodyContentHtml(String bodyContentHtml)
      Sets the HTML body content.
      Parameters:
      bodyContentHtml - The HTML body content
      Since:
      1.7.0
    • getBodyContentText

      public String getBodyContentText()
      Gets the TEXT body content.
      Returns:
      The TEXT body content
      Since:
      1.7.0
    • setBodyContentText

      public void setBodyContentText(String bodyContentText)
      Sets the TEXT body content.
      Parameters:
      bodyContentText - The TEXT body content
      Since:
      1.7.0
    • getFromAddress

      public String getFromAddress()
      Gets the sender address.
      Returns:
      The sender address
      Since:
      1.7.0
    • getFromName

      public String getFromName()
      Gets the sender name.
      Returns:
      The sender name
      Since:
      1.7.0
    • setFrom

      public void setFrom(String address)
      Sets the sender (aka. From).
      Parameters:
      address - The sender address
      Since:
      1.7.0
    • setFrom

      public void setFrom(String address, String name)
      Sets the sender (aka. From).
      Parameters:
      address - The sender address
      name - The sender name
      Since:
      1.7.0
    • getReplyTo

      public String getReplyTo()
      Gets the destination to use in case recipient choose to reply to your mail.
      Returns:
      The destination to use as "reply-to"
      Since:
      1.7.0
    • setReplyTo

      public void setReplyTo(String replyTo)
      Sets the destination to use in case recipient choose to reply to your mail.
      Parameters:
      replyTo - The destination to use as "reply-to"
      Since:
      1.7.0
    • getRecipients

      public Set<String> getRecipients()
      Gets all recipients.
      Returns:
      A set of recipients
      Since:
      1.7.0
    • addRecipient

      public void addRecipient(String recipient)
      Adds recipient.
      Parameters:
      recipient - Recipient to add
      Since:
      1.7.0
    • getCarbonCopyRecipients

      public Set<String> getCarbonCopyRecipients()
      Gets all carbon copy recipients.
      Returns:
      A set of carbon copy recipients
      Since:
      1.7.0
    • addCarbonCopyRecipient

      public void addCarbonCopyRecipient(String carbonCopyRecipient)
      Adds carbon copy recipient.
      Parameters:
      carbonCopyRecipient - Carbon copy recipient to add
      Since:
      1.7.0
    • getBlindCarbonCopyRecipients

      public Set<String> getBlindCarbonCopyRecipients()
      Gets all blind carbon copy recipients.
      Returns:
      A set of blind carbon copy recipients
      Since:
      1.7.0
    • addBlindCarbonCopyRecipient

      public void addBlindCarbonCopyRecipient(String blindCarbonCopyRecipient)
      Adds blind carbon copy recipient.
      Parameters:
      blindCarbonCopyRecipient - Blind carbon copy recipient to add
      Since:
      1.7.0
    • getAttachmentList

      public List<Mail.Attachment> getAttachmentList()
      Gets all attachments.
      Returns:
      A list of attachments
      Since:
      1.7.0
    • addAttachment

      public void addAttachment(String name, InputStream inputStream)
      Adds an attachment.
      Parameters:
      name - Name of the attachment (aka filename)
      inputStream - Attachment content
      Since:
      1.7.0