---
title: "handler(for:)"
framework: mailkit
role: symbol
role_heading: Instance Method
path: "mailkit/meextension/handler(for:)"
---

# handler(for:)

Returns an object that participates in the composition of a mail message.

## Declaration

```swift
optional func handler(for session: MEComposeSession) -> any MEComposeSessionHandler
```

## Parameters

- `session`: An object that represents a mail compose window.

## Return Value

Return Value An object that participates in the composition of a mail message.

## Discussion

Discussion MailKit invokes this method for each compose window it displays.
