<!--
{
  "availability" : [
    "macOS: 12.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MailKit",
  "identifier" : "/documentation/MailKit/MEExtension/handler(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "MailKit"
    ],
    "preciseIdentifier" : "c:objc(pl)MEExtension(im)handlerForComposeSession:"
  },
  "title" : "handler(for:)"
}
-->

# handler(for:)

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

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

## Parameters

`session`

An object that represents a mail compose window.

## Return Value

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

## Discussion

MailKit invokes this method for each compose window it displays.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)