# Mail pipeline

> Every message that goes through wp_mail() passes these hooks, in the order they fire: intake, validation, header normalization, connection resolution, the PHPMailer hand-off, transport, the send result.

| Hook | Kind | Tier | Since | Summary |
| --- | --- | --- | --- | --- |
| [`boolean_smtp_before_send`](/hooks/boolean_smtp_before_send/) | action | A | 1.0.0 | Fires immediately before a message is sent, after the connection and transport have been configured. |
| [`boolean_smtp_email_headers`](/hooks/boolean_smtp_email_headers/) | filter | A | 1.0.0 | Filters the custom headers collected from PHPMailer before the message is logged. |
| [`boolean_smtp_mail_after_validate`](/hooks/boolean_smtp_mail_after_validate/) | action | A | 1.0.0 | Fires after a message has passed validation, before headers are normalized. |
| [`boolean_smtp_mail_attempt_recorded`](/hooks/boolean_smtp_mail_attempt_recorded/) | action | B | 1.0.0 | Fires after a send attempt has been recorded in the email log. |
| [`boolean_smtp_mail_before_log`](/hooks/boolean_smtp_mail_before_log/) | action | B | 1.0.0 | Fires before an outgoing message is offered to the email log. |
| [`boolean_smtp_mail_before_phpmailer`](/hooks/boolean_smtp_mail_before_phpmailer/) | action | A | 1.0.0 | Fires after PHPMailer has been built from the message, before phpmailer_init runs. |
| [`boolean_smtp_mail_connection_resolved`](/hooks/boolean_smtp_mail_connection_resolved/) | action | A | 1.0.0 | Fires after a connection has been resolved for an outgoing message, before it is applied to PHPMailer. |
| [`boolean_smtp_mail_fallback`](/hooks/boolean_smtp_mail_fallback/) | action | A | 1.0.0 | Fires before a failed send is retried through the fallback connection. |
| [`boolean_smtp_mail_headers`](/hooks/boolean_smtp_mail_headers/) | filter | A | 1.0.0 | Filters the header bag built from the message before normalization. |
| [`boolean_smtp_mail_headers_normalized`](/hooks/boolean_smtp_mail_headers_normalized/) | action | B | 1.0.0 | Fires after headers have been normalized, before they are written back onto the message. |
| [`boolean_smtp_mail_intake`](/hooks/boolean_smtp_mail_intake/) | action | A | 1.0.0 | Fires when a message enters the BooleanSMTP mail pipeline, before validation runs. |
| [`boolean_smtp_mail_send_result`](/hooks/boolean_smtp_mail_send_result/) | action | A | 1.0.0 | Fires after a send attempt has completed, whether it succeeded or failed. |
| [`boolean_smtp_mail_transport_send`](/hooks/boolean_smtp_mail_transport_send/) | action | B | 1.0.0 | Fires immediately before the message is handed to PHPMailer's transport. |
| [`boolean_smtp_mail_validate`](/hooks/boolean_smtp_mail_validate/) | filter | A | 1.0.0 | Filters whether a message should be rejected before it is processed further. |
| [`boolean_smtp_mailer_resolved`](/hooks/boolean_smtp_mailer_resolved/) | action | B | 1.0.0 | Fires after the mailer has been fully configured for a send, with diagnostic details about the resolved connection and transport. |
| [`boolean_smtp_max_retry_attempts`](/hooks/boolean_smtp_max_retry_attempts/) | filter | A | 1.0.0 | Filters how many times a failed message is retried on other connections. |
| [`boolean_smtp_message_body`](/hooks/boolean_smtp_message_body/) | filter | A | 1.0.0 | Filters the message body immediately before it is sent. |
| [`boolean_smtp_plain_text_body`](/hooks/boolean_smtp_plain_text_body/) | filter | A | 1.0.0 | Filters the automatically generated plain-text alternative body. |
| [`boolean_smtp_queue_should_enqueue`](/hooks/boolean_smtp_queue_should_enqueue/) | filter | A | 1.0.0 | Filters whether a message is queued for background delivery instead of being sent now. |
| [`boolean_smtp_resolve_connection`](/hooks/boolean_smtp_resolve_connection/) | filter | A | 1.0.0 | Filters the connection resolved for an outgoing message, after routing rules and sender matching have run. |
| [`boolean_smtp_resolve_routing_rule_connection`](/hooks/boolean_smtp_resolve_routing_rule_connection/) | filter | A | 1.0.0 | Filters the connection a routing rule resolves for an outgoing message. |
| [`boolean_smtp_should_log_email`](/hooks/boolean_smtp_should_log_email/) | filter | A | 1.0.0 | Filters whether a message is written to the email log. |
| [`boolean_smtp_skip_fallback_retry`](/hooks/boolean_smtp_skip_fallback_retry/) | filter | A | 1.0.0 | Filters whether the fallback retry should be skipped for a failed send. |
| [`boolean_smtp_transports`](/hooks/boolean_smtp_transports/) | filter | A | 1.0.0 | Filters the map of registered transport drivers. |
