
## CreateAttachmentFromString (1 of 3) {#createattachmentfromstring_1}

Creates the attachment from string.

**Returns:** Returns created attachment

```cpp
CreateAttachmentFromString(System::String content, System::SharedPtr < Aspose::Email::Mime::ContentType > contentType)
```

| Parameter | Description |
| --- | --- |
| content | A string that represents the content of attachment. |
| contentType | The ContentType . |

---

## CreateAttachmentFromString (2 of 3) {#createattachmentfromstring_2}

Creates the attachment from string.

**Returns:** Returns created attachment

```cpp
CreateAttachmentFromString(System::String content, System::String name)
```

| Parameter | Description |
| --- | --- |
| content | A string that represents the content of attachment. |
| name | The attachment name. |

---

## CreateAttachmentFromString (3 of 3) {#createattachmentfromstring_3}

Creates the attachment from string.

**Returns:** Returns created attachment

```cpp
CreateAttachmentFromString(System::String content, System::String name, System::SharedPtr < System::Text::Encoding > contentEncoding, System::String mediaType)
```

| Parameter | Description |
| --- | --- |
| content | A string that represents the content of attachment. |
| name | The attachment name. |
| contentEncoding | The content encoding. |
| mediaType | The media type name |

