---
Product: Aspose.Email
Platform: net
Page Type: reference
Canonical URL: https://reference.aspose.org/email/net/mapi-property-collection
---

# MapiPropertyCollection

## Overview

`MapiPropertyCollection` is a keyed collection of `MapiProperty` objects indexed by property ID and type code. Use `Set` to add-or-replace a property, `Add` to construct and insert a new one, `Get` to retrieve an existing entry, `Remove` to delete it, and `IterProperties` to enumerate all stored properties. Accessible via `MapiMessage.Properties`, `MapiAttachment.Properties`, and `MapiRecipient.Properties`.

## Methods

| Signature | Description |
|-----------|-------------|
| `Set(property: MapiProperty)` | Adds `property` to the collection, replacing any existing entry with the same property tag. |
| `Add(propertyId: ushort, propertyType: ushort, value: object?, flags: uint)` | Constructs a new `MapiProperty` and adds it to the collection. |
| `Get(propertyId: ushort, propertyType: ushort?)` | Returns the `MapiProperty` matching `propertyId` and optional `propertyType`, or `null` if not found. |
| `Remove(propertyId: ushort, propertyType: ushort?)` | Removes the property identified by `propertyId` and optional `propertyType` from the collection. |
| `IterProperties()` | Enumerates all `MapiProperty` entries in the collection. |

## See Also
- [Aspose.Email for .NET — Enterprise API Reference](https://reference.aspose.com/email/net/)