new_binary
Since: Version 2025.10.06-5ec871ab
The functionality described in this section requires version 2025.10.06-5ec871ab of KumoMTA, or a more recent version.
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-Idheader for the mime part, which is useful when generating HTML content that references an attachment.