---
schema_version: "1"
id: fe65a6bf659452a9a908e1bbf051a7b78f006280308c75c4ebf2a5d4b5b1382b
title: InboundEmail.BinaryAttachment Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_classes_email_inbound_binary.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_inbound_binary.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: be93a62bc5067398e6c60f16009ef86206102f62375ade4c451b078f14afda6a
description: An InboundEmail object stores binary attachments in an InboundEmail.BinaryAttachment object.Creates a new instance of the Messaging.InboundEmail.BinaryAttachment class.The body of the attachment.The name of the attached file.Any header values associated with the attachment. Examples of header names include Content-Type, Content-Transfer-Encoding, and Content-ID.The primary and sub MIME-type.
---
# InboundEmail.BinaryAttachment Class

An InboundEmail object stores binary attachments in an InboundEmail.BinaryAttachment object.

## Namespace

[Messaging](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_Messaging.htm "The Messaging namespace provides classes and methods for Salesforce notifications and email functionality.")

## Usage

Examples of binary attachments include image, audio, application, and video files.

- **[InboundEmail.BinaryAttachment Constructors](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_inbound_binary.htm#apex_Messaging_InboundEmail_BinaryAttachment_constructors)**
- **[InboundEmail.BinaryAttachment Properties](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_inbound_binary.htm#apex_Messaging_BinaryAttachment_Properties)**

## InboundEmail.BinaryAttachment Constructors

The following are constructors for InboundEmail.BinaryAttachment.

- **[InboundEmail.BinaryAttachment()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_inbound_binary.htm#apex_Messaging_InboundEmail_BinaryAttachment_ctor)**  
    Creates a new instance of the Messaging.InboundEmail.BinaryAttachment class.

### InboundEmail.BinaryAttachment()

Creates a new instance of the Messaging.InboundEmail.BinaryAttachment class.

#### Signature

public InboundEmail.BinaryAttachment()

## InboundEmail.BinaryAttachment Properties

The following are properties for InboundEmail.BinaryAttachment.

- **[body](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_inbound_binary.htm#apex_Messaging_BinaryAttachment_body)**  
    The body of the attachment.
- **[fileName](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_inbound_binary.htm#apex_Messaging_BinaryAttachment_fileName)**  
    The name of the attached file.
- **[headers](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_inbound_binary.htm#apex_Messaging_BinaryAttachment_headers)**  
    Any header values associated with the attachment. Examples of header names include Content-Type, Content-Transfer-Encoding, and Content-ID.
- **[mimeTypeSubType](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_inbound_binary.htm#apex_Messaging_BinaryAttachment_mimeTypeSubType)**  
    The primary and sub MIME-type.

### body

The body of the attachment.

#### Signature

public Blob body {get; set;}

#### Property Value

Type: [Blob](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_blob.htm#apex_methods_system_blob "Contains methods for the Blob primitive data type.")

### fileName

The name of the attached file.

#### Signature

public String fileName {get; set;}

#### Property Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

### headers

Any header values associated with the attachment. Examples of header names include Content-Type, Content-Transfer-Encoding, and Content-ID.

#### Signature

public List<Messaging.InboundEmail.Header> headers {get; set;}

#### Property Value

Type: [List](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_list.htm#apex_methods_system_list "Contains methods for the List collection type.")<[Messaging.InboundEmail.Header](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_inbound_header.htm#apex_classes_email_inbound_header "An InboundEmail object stores RFC 2822 email header information in an InboundEmail.Header object with the following properties.")\>

### mimeTypeSubType

The primary and sub MIME-type.

#### Signature

public String mimeTypeSubType {get; set;}

#### Property Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")