case class Content(parts: MimeBodyPart*) extends Product with Serializable
Represents the content of the e-mail message, composed of individual MimeBodyPart instances.
For easier use, helper methods to add specific content are available, such as html() for
adding HTML or attachFile() to add file attachment.
- parts
parts of the message content (represented by
MimeBodyPartinstances)
- Alphabetic
- By Inheritance
- Content
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Content(parts: MimeBodyPart*)
- parts
parts of the message content (represented by
MimeBodyPartinstances)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def append(parts: MimeBodyPart*): Content
Appends the given part (represented by
MimeBodyPartinstance) to the existing content parts.Appends the given part (represented by
MimeBodyPartinstance) to the existing content parts.- parts
content part to append
- returns
instance of the com.github.jurajburian.mailer.Content class with appended content part
- def apply(): MimeMultipart
- Annotations
- @throws(scala.this.throws.<init>$default$1[jakarta.mail.MessagingException])
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def attachBase64(data: String, mimeType: String, name: Option[String] = None, contentId: Option[String] = None, headers: Seq[MessageHeader] = Seq.empty[MessageHeader]): Content
Appends the given string of Base64-encoded data as the e-mail message attachment.
Appends the given string of Base64-encoded data as the e-mail message attachment. Use instead of the
#attachBytesmethod if you have already Base64-encoded data and you want to avoid JavaMail encoding it again.- data
Base64-encoded data
- mimeType
MIME type of the attachment
- name
name of the attachment (optional)
- contentId
the
Content-IDheader field of this body part (optional)- headers
content part headers (RFC 822)
- returns
instance of the com.github.jurajburian.mailer.Content class with appended content part
- See also
http://www.oracle.com/technetwork/java/faq-135477.html#preencoded
- def attachBytes(bytes: Array[Byte], mimeType: String, name: Option[String] = None, contentId: Option[String] = None, headers: Seq[MessageHeader] = Seq.empty[MessageHeader]): Content
Appends the given array of bytes as the e-mail message attachment.
Appends the given array of bytes as the e-mail message attachment. Useful especially when the original file object is not available, only its array of bytes.
- bytes
array of bytes representing the attachment
- mimeType
MIME type of the attachment
- name
name of the attachment (optional)
- contentId
the "Content-ID" header field of this body part (optional)
- headers
content part headers (RFC 822)
- returns
instance of the com.github.jurajburian.mailer.Content class with appended content part
- def attachFile(file: File, name: Option[String] = None, contentId: Option[String] = None, headers: Seq[MessageHeader] = Seq.empty[MessageHeader]): Content
Appends the given file as the e-mail message attachment.
Appends the given file as the e-mail message attachment.
- file
file to attach
- name
name of the attachment (optional, defaults to the given file name)
- contentId
the "Content-ID" header field of this body part
- headers
content part headers (RFC 822)
- returns
instance of the com.github.jurajburian.mailer.Content class with appended content part
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def html(html: String, charset: String = "UTF-8", headers: Seq[MessageHeader] = Seq.empty[MessageHeader]): Content
Appends the given HTML string as the new HTML content part.
Appends the given HTML string as the new HTML content part.
- html
HTML string to append
- charset
charset of the given HTML string (defaults to UTF-8)
- headers
content part headers (RFC 822)
- returns
instance of the com.github.jurajburian.mailer.Content class with appended content part
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val parts: MimeBodyPart*
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def text(text: String, charset: String = "UTF-8", subtype: String = "plain", headers: Seq[MessageHeader] = Seq.empty[MessageHeader]): Content
Appends the given string as the text content part (defaults to text/plain).
Appends the given string as the text content part (defaults to text/plain).
- text
text to append
- charset
charset of the given text (defaults to UTF-8)
- subtype
defines subtype of the MIME type (the part after the slash), defaults to UTF-8
- headers
content part headers (RFC 822)
- returns
instance of the com.github.jurajburian.mailer.Content class with appended content part
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()