# boolean_smtp_email_headers

> Filters the custom headers collected from PHPMailer before the message is logged.

Filter · Tier A · Since 1.0.0

Return a modified array to change what is recorded.

## Signature

```php
add_filter( 'boolean_smtp_email_headers', $callback, 10, 2 );
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `$headers` | `array<string, string>` | Custom header name/value pairs collected from PHPMailer. |
| `$to` | `string` | Primary recipient address. |

**Returns** `array<string, string>` — The filtered headers.

## Fires in

- [app/Services/Mailer/MailerManager.php:321](https://github.com/booleanpress/boolean-smtp-src/blob/main/app/Services/Mailer/MailerManager.php#L321) — `BooleanSmtp\Services\Mailer\MailerManager::configure()`

## Example

```php
add_filter( 'boolean_smtp_email_headers', function ( array $headers, string $to ) {
    return $headers;
}, 10, 2 );
```
