---
title: "additionalHeaders(for:)"
framework: mailkit
role: symbol
role_heading: Instance Method
path: "mailkit/mecomposesessionhandler/additionalheaders(for:)"
---

# additionalHeaders(for:)

Provides custom headers to include in the outgoing message.

## Declaration

```swift
optional func additionalHeaders(for session: MEComposeSession) -> [String : [String]]
```

## Parameters

- `session`: The session that represents the properties of the message in the compose window.

## Return Value

Return Value A dictionary that maps header keys to arrays of string values.

## Discussion

Discussion To add custom headers to an outgoing message, return a dictionary that contains the header key and an array of one or more values. note: MailKit ignores entries in the dictionary for standard headers such as Subject. The following code shows an example of adding two custom headers: one with a single value, and another with multiple values. func additionalHeaders(for session: MEComposeSession) -> [String : [String]] {     // To insert custom headers into a message, return a dictionary with     // the key and an array of one or more values.     return [         "X-CustomHeader": ["This is a custom header."],         "X-CustomColors": ["Red", "Green", "Blue"]     ] } The resulting message contains the following headers: X-Customcolors: Red X-Customcolors: Green X-Customcolors: Blue X-Customheader: This is a custom header. note: Header keys in mail messages are case-insensitive, so don’t make assumptions about the capitalization of header.
