new_binary
Since: Dev Builds Only
The functionality described in this section requires a dev build of KumoMTA. You can obtain a dev build by following the instructions in the Installation section.
Constructs a new MimePart for binary content.
You must provide the content type and the content itself; the content can be any binary lua string (including strings that are actually UTF-8 text).
The MimePart will use appropriate transfer encoding for the binary data.
You may optionally specify parameters that will affect how the part will appear
when used as an attachment; if you don't care about these, you can omit the
third parameter, or pass nil
. If you do want to specify them, then you can
pass a lua table that allows for the following fields, which influence the Content-Disposition
header in the resulting mime part:
file_name
- an optional string to use to define the attachment file name.inline
- an optional boolean that indicates whether the attachment will be marked as being an inline attachment. The default isfalse
.content_id
- an optional string that can be used to define theContent-Id
header for the mime part, which is useful when generating HTML content that references an attachment.