MimeMultipart
class in package klyn.mails

    public class MimeMultipart extends Object:

Object
└ MimeMultipart

MIME multipart container.

Supported subtypes include `mixed`, `alternative` and `related`.

    import klyn.mails

    multipart = MimeMultipart("alternative")
    multipart.addText("Hello")
    multipart.addHtml("<strong>Hello</strong>")

Fields

Modifier and Type | Member | Description
--- | --- | ---
public readonly | headers `headers as Map<String, String>` | Additional multipart headers.

Properties

Modifier and Type | Member | Description
--- | --- | ---
public property | boundary `boundary as String` | Boundary marker used for serialization.
public readonly property | partCount `partCount as Int:` | Returns the number of direct child parts.
public property | subType `subType as String` | Multipart subtype, for example `mixed` or `alternative`.

Properties inherited from Object: type
Constructors

Modifier and Type | Member | Description
--- | --- | ---
public | MimeMultipart `MimeMultipart(subType as String = "mixed", boundary as String = ""):` | Creates a multipart container.

Methods

Modifier and Type | Member | Description
--- | --- | ---
public | addHtml `addHtml(content as String, charset as String = "UTF-8") as MimeMultipart:` | Adds an HTML body part.
public | addMultipart `addMultipart(part as MimeMultipart) as MimeMultipart:` | Adds a nested multipart.
public | addPart `addPart(part as MimeBodyPart) as MimeMultipart:` | Adds a body part.
public | addText `addText(content as String, charset as String = "UTF-8") as MimeMultipart:` | Adds a plain text body part.
public | attachBase64 `attachBase64(fileName as String, base64Content as String) as MimeMultipart:` | Adds an attachment whose payload is already Base64-encoded.
public | attachBase64 `attachBase64(fileName as String, base64Content as String, contentType as String) as MimeMultipart:` | Adds a Base64 attachment with an explicit content type.
public | attachText `attachText(fileName as String, content as String) as MimeMultipart:` | Adds a text attachment.
public | attachText `attachText(fileName as String, content as String, contentType as String) as MimeMultipart:` | Adds a text attachment with an explicit content type.
public | clear `clear() as MimeMultipart:` | Removes all child parts.
public | header `header(name as String, value as String) as MimeMultipart:` | Adds or replaces a multipart header.
public static | mixed `mixed() as MimeMultipart:` | Creates a `multipart/mixed` container.
public static | related `related() as MimeMultipart:` | Creates a `multipart/related` container.

Methods inherited from Object: fromJson, toDict, toJson, toString, toXml