---
schema_version: "1"
id: 06b05627d99d4b746b55970a96af1f00e0c4a315c8cc428ac1c7e9bc04645efa
title: InboundEmail.TextAttachment Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_classes_email_inbound_text.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_inbound_text.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 0c9860234837ca851b1be0f9acca77f1e72438d9cca6d6541908ce5b0ebf093e
description: An InboundEmail object stores text attachments in an InboundEmail.TextAttachment object.Creates a new instance of the Messaging.InboundEmail.TextAttachment class.The body of the attachment.Indicates whether the attachment body text is truncated (true) or not (false.)The original character set of the body field. The body is re-encoded as UTF-8 as input to the Apex method.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.TextAttachment Class

An InboundEmail object stores text attachments in an InboundEmail.TextAttachment 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

The text attachments can be any of the following:

- Attachments with a Multipurpose Internet Mail Extension (MIME) type of text
- Attachments with a MIME type of application/octet-stream and a file name that ends with either a .vcf or .vcs extension. These are saved as text/x-vcard and text/calendar MIME types, respectively.

- **[InboundEmail.TextAttachment Constructors](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_inbound_text.htm#apex_Messaging_InboundEmail_TextAttachment_constructors)**
- **[InboundEmail.TextAttachment Properties](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_inbound_text.htm#apex_Messaging_InboundEmail_TextAttachment_Properties)**

## InboundEmail.TextAttachment Constructors

The following are constructors for InboundEmail.TextAttachment.

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

### InboundEmail.TextAttachment()

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

#### Signature

public InboundEmail.TextAttachment()

## InboundEmail.TextAttachment Properties

The following are properties for InboundEmail.TextAttachment.

- **[body](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_inbound_text.htm#apex_Messaging_TextAttachment_body)**  
    The body of the attachment.
- **[bodyIsTruncated](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_inbound_text.htm#apex_Messaging_TextAttachment_bodyIsTruncated)**  
    Indicates whether the attachment body text is truncated (true) or not (false.)
- **[charset](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_inbound_text.htm#apex_Messaging_TextAttachment_charset)**  
    The original character set of the body field. The body is re-encoded as UTF-8 as input to the Apex method.
- **[fileName](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_inbound_text.htm#apex_Messaging_TextAttachment_fileName)**  
    The name of the attached file.
- **[headers](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_inbound_text.htm#apex_Messaging_InboundEmail_TextAttachment_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_text.htm#apex_Messaging_TextAttachment_mimeTypeSubType)**  
    The primary and sub MIME-type.

### body

The body of the attachment.

#### Signature

public String body {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.")

### bodyIsTruncated

Indicates whether the attachment body text is truncated (true) or not (false.)

#### Signature

public Boolean bodyIsTruncated {get; set;}

#### Property Value

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

### charset

The original character set of the body field. The body is re-encoded as UTF-8 as input to the Apex method.

#### Signature

public String charset {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.")

### 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.")