Skip to main content

Type Alias: MailAttachment

type MailAttachment: object;

Attachment payload supplied to a mailer when sending transactional emails. Not every provider supports attachments—consult your mailer for limits.

Type declaration​

content​

content: Buffer | string;

File data, either as a Buffer or base64 string.

contentType?​

optional contentType: string;

MIME type for the attachment. Many providers infer this automatically.

filename​

filename: string;

Filename visible to recipients (e.g. invoice.pdf).

Example​

{ filename: 'receipt.pdf', content: pdfBuffer, contentType: 'application/pdf' }