<!--
{
  "availability" : [
    "macOS: 12.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MailKit",
  "identifier" : "/documentation/MailKit",
  "metadataVersion" : "0.1.0",
  "role" : "Framework",
  "symbol" : {
    "kind" : "Framework",
    "modules" : [
      "MailKit"
    ],
    "preciseIdentifier" : "MailKit"
  },
  "title" : "MailKit"
}
-->

# MailKit

Secure, customize, and act on email messages that users send and receive.

## Overview

MailKit lets your app include an app extension that customizes several features of Mail. A Mail app extension provides one or more of the following enhancements:

- A *content blocker* defines rules to prevent loading content when users view messages.
- An *action handler* performs actions such as flagging, setting colors, or archiving when Mail downloads messages.
- A *compose session handler* validates recipient email addresses, displays a view controller on Mail’s compose windows, confirms if messages are suitable for delivery, and adds custom headers.
- A *message security handler* secures messages using encryption and digital signatures.

The entry point for your extension is an object that conforms to [`MEExtension`](/documentation/MailKit/MEExtension). When MailKit invokes your extension, this objects determines the handlers that provide each capability in the list above.

## Topics

### Essentials

[`MEExtension`](/documentation/MailKit/MEExtension)

A type that provides objects for manipulating email messages, such as performing actions on messages or blocking content when users view messages.

[Build Mail App Extensions](/documentation/MailKit/build-mail-app-extensions)

Create app extensions that block content, perform message and composing actions, and help message security.

### Content Blockers

[`MEContentBlocker`](/documentation/MailKit/MEContentBlocker)

An object that provides a set of rules to block content when displaying a message.

### Message Actions

[`MEMessageActionHandler`](/documentation/MailKit/MEMessageActionHandler)

An object that performs actions on messages as the system downloads them.

### Compose Window Enhancements

[`MEComposeSessionHandler`](/documentation/MailKit/MEComposeSessionHandler)

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

### Message Encryption, Decryption, and Digital Signatures

[`MEMessageSecurityHandler`](/documentation/MailKit/MEMessageSecurityHandler)

An object that digitally signs or encrypts messages the user sends and receives.

### Message Properties

[`MEMessage`](/documentation/MailKit/MEMessage)

An object that contains information about a mail message, such as the subject, addressees, date sent, and the message contents.

[`MEMessageState`](/documentation/MailKit/MEMessageState)

The state of a message: sent, unsent, or received.

### Custom View Controllers

[`MEExtensionViewController`](/documentation/MailKit/MEExtensionViewController)

An object that manages a view for compose session and message security handlers.

### Structures

[`MEMessageSecurityError`](/documentation/MailKit/MEMessageSecurityError)

### Classes

[`MEComposeContext`](/documentation/MailKit/MEComposeContext)

[`MEDecodedMessageBanner`](/documentation/MailKit/MEDecodedMessageBanner)

[`MEEmailAddress`](/documentation/MailKit/MEEmailAddress)

[`MEExtensionManager`](/documentation/MailKit/MEExtensionManager)

### Reference

[MailKit Enumerations](/documentation/MailKit/mailkit-enumerations)

[MailKit Constants](/documentation/MailKit/mailkit-constants)



---

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)
