TechnologiesApp Extensions & System Integration

MailKit

iOSmacOStvOSwatchOSvisionOS

MailKit lets you build Mail app extensions for macOS that integrate directly into the message lifecycle. You can annotate recipient addresses with MEAddressAnnotation and MEEmailAddress, block content by adopting MEContentBlocker, and handle compose sessions through MEComposeSession and MEComposeContext. Adopt protocols such as MEMessageActionHandler, MEMessageDecoder, and MEMessageEncoder to act on messages, decode and encode them, and report message and encryption state with types like MEDecodedMessage, MEEncodedOutgoingMessage, MEMessageState, and MEMessageEncryptionState.

Essentials 2

Register your Mail extension and provide the view controllers that surface its interface.

  • Cl
    MEExtensionManagermacOS 12.0+
    @brief Methods in this class allow the host app to interact with their Mail extension.
  • Cl
    MEExtensionViewControllermacOS 12.0+
    A view controller that presents your Mail extension's interface within the Mail app.

Messages and Addresses 3

Represent the messages, recipient addresses, and annotations your extension inspects.

  • Cl
    MEMessagemacOS 12.0+
    @brief Contains information about a mail message on which actions can be performed.
  • Cl
    MEEmailAddressmacOS 12.0+
    @brief Contain information about an email address. This can include both valid and invalid email addresses.
  • Cl
    MEAddressAnnotationmacOS 12.0+
    @brief An instance of this class can be used to change the visual style of recipeint email address token when user in composing a mail message.

Compose Sessions 4

Observe and influence the user's compose session and its lifecycle.

  • Cl
    MEComposeSessionmacOS 12.0+
    @brief An instance of this class is associated with the lifecycle of a single mail compose window. This object associates the actions performed by the user in a mail compose window to a unique session
  • Cl
    MEComposeContextmacOS 12.0+
    @brief An object encapsulating additional information about the message being composed.
  • En
    MEComposeUserActionmacOS 12.0+
    @brief An enumeration corresponding to the action user took to start a new mail compose window.
  • St
    MEComposeSessionErrormacOS 12.0+
    A structure that describes errors that occur during a compose session.

Message Actions 3

Act on incoming messages and decide how Mail should handle them.

  • Pr
    MEMessageActionHandlermacOS 12.0+
    @brief Methods in this protocol can be used by a mail app extension to perform actions on messages as they are downloaded.
  • Cl
    MEMessageActionmacOS 12.0+
    @brief An action that can be performed on a mail message.
  • Cl
    MEMessageActionDecisionmacOS 12.0+
    An object that represents the action decision your extension returns for a message.

Decoding Messages 3

Decode received messages and present decoded content and banners to the user.

  • Pr
    MEMessageDecodermacOS 12.0+
    @brief Methods in this protocol can be used by a mail app extension to decode messages.
  • Cl
    MEDecodedMessagemacOS 12.0+
    @brief Contains information about a decoded message
  • Cl
    MEDecodedMessageBannermacOS 12.0+
    @brief Contains security information in order to populate a banner in the message view.

Encoding and Signing Outgoing Messages 5

Encode, sign, and report the security state of outgoing messages.

  • Pr
    MEMessageEncodermacOS 12.0+
    @brief Methods in this protocol can be used by a mail app extension to encode messages.
  • Cl
    MEEncodedOutgoingMessagemacOS 12.0+
    An object that represents the encoded data and security details of an outgoing message.
  • Cl
    MEMessageEncodingResultmacOS 12.0+
    @brief Contains information about an outging mail message after any security measures have been applied.
  • Cl
    MEOutgoingMessageEncodingStatusmacOS 12.0+
    @brief Contains information about any security measures that will be applied to a mail message when it is sent or any errrors that occurred while verifying security status.
  • Cl
    MEMessageSignermacOS 12.0+
    @brief Contains information about a message signer

Message Security 4

Convey signing, encryption, and trust information for messages.

  • Cl
    MEMessageSecurityInformationmacOS 12.0+
    @brief Contains security information about a decoded message
  • En
    MEMessageStatemacOS 12.0+
    Constants that describe the security state of a message.
  • En
    MEMessageEncryptionStatemacOS 12.0+
    Constants that describe the encryption state of a message.
  • St
    MEMessageSecurityErrormacOS 12.0+
    A structure that describes errors related to message security operations.

Content Blocking 1

Block remote content and other resources from loading in messages.

  • Pr
    MEContentBlockermacOS 12.0+
    @brief Methods in this protocol can be used by a mail app extension to block content in mail messages.

Protocols 3

  • Pr
    MEComposeSessionHandlermacOS 12.0+
    @brief Methods in this protocol can be used by a mail app extension to keep track of new messages composed by the user and to make changes to the recipeint email address tokens.
  • Pr
    MEExtensionmacOS 12.0+
    @brief A protocol which must be adopted by the class set as extension's `NSExtensionPrincipalClass`.
  • Pr
    MEMessageSecurityHandlermacOS 12.0+
← App Extensions & System Integration