Represents an email attachment.

This interface defines the structure of an attachment, including its filename, MIME type, size, and content.

Attachment

0.0.1

interface Attachment {
    content: string;
    contentType: string;
    filename: string;
    size: number;
}

Properties

content: string

The content of the attachment.

This contains the actual file data as written in the email message.

/9j/4AAQSkZJRgABAQEAEQARAAD/2wB //JPEG example

0.0.1

contentType: string

The MIME type of the attachment.

This indicates the media type of the file, as specified in the Content-Type header.

"application/pdf"
"image/jpeg"
"text/plain"

0.0.1

filename: string

The name of the attachment file.

This is the filename as provided in the email message.

"invoice.pdf"
"image.png"

0.0.1

size: number

The size of the attachment in bytes.

Represents the total number of bytes in the attachment content.

102400  // 100 KB
512     // 512 bytes

0.0.1