---
title: MEComposeSessionHandler
framework: mailkit
role: symbol
role_heading: Protocol
path: mailkit/mecomposesessionhandler
---

# MEComposeSessionHandler

An object that participates in the composition of mail messages, and annotates recipient tokens.

## Declaration

```swift
@MainActor protocol MEComposeSessionHandler : NSObjectProtocol
```

## Overview

Overview When the user composes a message, MailKit requests a compose session handler object from your extension. MailKit uses this handler in the following ways: To inform it when the compose session begins and ends To add status annotations for email addresses that the user enters into the To, Cc, and Bcc fields To display a custom popover in the compose window To include custom headers in an outgoing message To confirm that an outgoing message is ready for delivery Each of the items in the list above corresponds to methods that the handler implements. To indicate that your extension contains a compose session handler, add MEComposeSessionHandler to the MEExtensionCapabilities array in the extension’s Info.plist file: <key>NSExtensionAttributes</key> <dict>     <key>MEExtensionCapabilities</key>     <array>         <string>MEComposeSessionHandler</string>     </array> </dict>

## Topics

### Handling Compose Sessions

- [MEComposeSession](mailkit/mecomposesession.md)
- [mailComposeSessionDidBegin(_:)](mailkit/mecomposesessionhandler/mailcomposesessiondidbegin(_:).md)
- [mailComposeSessionDidEnd(_:)](mailkit/mecomposesessionhandler/mailcomposesessiondidend(_:).md)
- [MEComposeSessionError](mailkit/mecomposesessionerror.md)

### Annotating Email Address Tokens

- [annotateAddressesForSession(_:completion:)](mailkit/mecomposesessionhandler/annotateaddressesforsession(_:completion:).md)
- [MEAddressAnnotation](mailkit/meaddressannotation.md)

### Extending the Compose Window Interface

- [viewController(for:)](mailkit/mecomposesessionhandler/viewcontroller(for:).md)

### Adding Custom Headers

- [additionalHeaders(for:)](mailkit/mecomposesessionhandler/additionalheaders(for:).md)

### Approving Message Delivery

- [allowMessageSendForSession(_:completion:)](mailkit/mecomposesessionhandler/allowmessagesendforsession(_:completion:).md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
