---
title: "MapiAttachment.Save"
url: "https://reference.aspose.com/email/net/aspose.email.mapi/mapiattachment/save/"
product: "Aspose.Email for .NET API Reference"
description: "MapiAttachment method. Saves the content of the attachment to a file. An embedded message is saved in MSG format"
---

## Save(string) {#save_1}

Saves the content of the attachment to a file. An embedded message is saved in MSG format.

```csharp
public void Save(string filename)
```

| Parameter | Type | Description |
| --- | --- | --- |
| filename | String | The path of the file to write. |

### Exceptions

| exception | condition |
| --- | --- |
| ArgumentNullException | *filename* is `null`. |

### See Also

* class [MapiAttachment](../)
* namespace [Aspose.Email.Mapi](../../mapiattachment/)
* assembly [Aspose.Email](../../../)

---

## Save(Stream) {#save}

Saves the content of the attachment to a stream. An embedded message is saved in MSG format.

```csharp
public void Save(Stream stream)
```

| Parameter | Type | Description |
| --- | --- | --- |
| stream | Stream | The stream to write to. |

### See Also

* class [MapiAttachment](../)
* namespace [Aspose.Email.Mapi](../../mapiattachment/)
* assembly [Aspose.Email](../../../)


