Attachment

Overview

Email attachments can be managed through an object providing methods to access their content, properties, and state. Attachments can be created using binary or text files and sent as part of an email.

Functionality

Email attachments support several operations. The getData() method retrieves the content of the attachment as a byte array. getMimeType() provides the MIME type, useful for identifying file formats. getName() returns the attachment's name for display or logging purposes. The isEmbedded() method checks if the attachment is embedded in the email body, determined by references in the email's text content.

These methods enable robust email attachment handling, including retrieving file properties and ensuring proper integration with email body content.

Methods Summarized

Type
Name
Summary

Returns a byte array with the content of this attachment.

Returns the Mime type of this attachment.

Returns the name of this attachment.

Returns true if this attachment is embedded, false otherwise.

Methods Detailed

getData()

Returns a byte array with the content of this attachment.

Returns: Array A byte array containing the content of this attachment.

Sample

getMimeType()

Returns the Mime type of this attachment.

Returns: String The MIME type of this attachment.

Sample

getName()

Returns the name of this attachment.

Returns: String The name of this attachment.

Sample

isEmbedded()

Returns true if this attachment is embedded, false otherwise. Attachments become embedded if they are references through tags from the body text of the message.

Returns: Boolean true if this attachment is embedded; false otherwise.

Sample


Last updated

Was this helpful?