Class MessageCreateOptions

java.lang.Object
com.mailosaur.models.MessageCreateOptions

public class MessageCreateOptions extends Object
Options to use when creating a new message.
  • Constructor Details

    • MessageCreateOptions

      public MessageCreateOptions()
  • Method Details

    • withTo

      public MessageCreateOptions withTo(String to)
      Sets the email address to which the email will be sent. Must be a verified email address.
      Parameters:
      to - The email address.
      Returns:
      the MessageCreateOptions object itself.
    • withFrom

      public MessageCreateOptions withFrom(String from)
      Partially overrides of the message's 'from' address. This **must** be an address ending with `YOUR_SERVER.mailosaur.net`, such as `my-emails@a1bcdef2.mailosaur.net`.
      Parameters:
      from - The email address.
      Returns:
      the MessageCreateOptions object itself.
    • withSend

      public MessageCreateOptions withSend(Boolean send)
      Sets whether the email should be sent upon creation.
      Parameters:
      send - If true, email will be sent upon creation.
      Returns:
      the MessageCreateOptions object itself.
    • withSubject

      public MessageCreateOptions withSubject(String subject)
      Sets the email subject line.
      Parameters:
      subject - The email subject line.
      Returns:
      the MessageCreateOptions object itself.
    • withText

      public MessageCreateOptions withText(String text)
      Sets any plain text to include when forwarding the message. Note that only text or html can be supplied, not both.
      Parameters:
      text - Plain text content to include when forwarding the message.
      Returns:
      the MessageCreateOptions object itself.
    • withHtml

      public MessageCreateOptions withHtml(String html)
      Sets any HTML content to include when forwarding the message. Note that only text or html can be supplied, not both.
      Parameters:
      html - HTML content to include when forwarding the message.
      Returns:
      the MessageCreateOptions object itself.
    • withAttachments

      public MessageCreateOptions withAttachments(List<Attachment> attachments)
      Sets any message attachments.
      Parameters:
      attachments - Any message attachments.
      Returns:
      the MessageCreateOptions object itself.