Local
Local
Local mail transport implementation using PHP's mail() function.
class Local extends \Hazaar\Mail\Transport\TransportSends email messages via the local system's sendmail utility, formatting headers and handling DSN options. Throws exceptions on failure.
Methods
init
Initializes the local mail transport, verifying the presence of the sendmail utility.
public init(array $options): boolChecks if sendmail is available on the system. Throws an exception if not found. Delegates further initialization to the parent transport.
Parameters
| Parameter | Type | Description |
|---|---|---|
$options | array | configuration options for the transport |
send
Sends an email message using the local system's sendmail utility via PHP's mail() function.
public send(TransportMessage $message): mixedFormats headers, handles DSN options, and extracts the sender address for proper delivery. Throws an exception if sending fails.
Parameters
| Parameter | Type | Description |
|---|---|---|
$message | TransportMessage | the message to send via local transport |
formatTo
Formats the recipient list for the mail() function.
private formatTo(array $tolist): stringConverts an array of recipient data into a comma-separated string suitable for use as the "to" parameter in mail().
Parameters
| Parameter | Type | Description |
|---|---|---|
$tolist | array | list of recipients, each as a string or array with 'name' and 'email' |
Generated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:23 +0000