HTTP
Less than 1 minute
HTTP
HTTP mail transport implementation.
class HTTP extends \Hazaar\Mail\Transport\TransportSends email messages via HTTP POST requests to a configured endpoint, using a schema to map message properties to request data. Supports custom headers and JSON encoding for payloads.
Properties
headers
protected array $headersschema
protected array $schema = array (
0 => NULL,
'send_at' => '$sendAt',
'to' => '$to',
'cc' => '$cc',
'bcc' => '$bcc',
'from' => '$from',
'reply_to' => '$replyTo',
'reply_to_list' => '$replyTo_list',
'subject' => '$subject',
'headers' => '$headers',
'attachments' => '$attachments',
'categories' => '$categories',
'batch_id' => '$batchId',
'content' => '$content',
)Methods
send
Sends an email message via HTTP POST to the configured endpoint.
public send(TransportMessage $message): mixedMaps message properties to request data using the schema, sets headers, and encodes the payload as JSON. Throws an exception on failure.
Parameters
| Parameter | Type | Description |
|---|---|---|
$message | TransportMessage | the message to send via HTTP transport |
addHeader
Adds a custom header to the HTTP request for email transport.
public addHeader(string $name, string $value): voidThe header will be included in all outgoing HTTP requests made by this transport instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
$name | string | The name of the header to add (e.g., 'Authorization'). |
$value | string | the value of the header |
Generated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:23 +0000