Package com.mailosaur.models
Class MessageCreateOptions
java.lang.Object
com.mailosaur.models.MessageCreateOptions
Options to use when creating a new message.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionwithAttachments(List<Attachment> attachments) Sets any message attachments.Partially overrides of the message's 'from' address.Sets any HTML content to include when forwarding the message.Sets whether the email should be sent upon creation.withSubject(String subject) Sets the email subject line.Sets any plain text to include when forwarding the message.Sets the email address to which the email will be sent.
-
Constructor Details
-
MessageCreateOptions
public MessageCreateOptions()
-
-
Method Details
-
withTo
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
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
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
Sets the email subject line.- Parameters:
subject- The email subject line.- Returns:
- the MessageCreateOptions object itself.
-
withText
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
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
Sets any message attachments.- Parameters:
attachments- Any message attachments.- Returns:
- the MessageCreateOptions object itself.
-