PhpMailDriver
in package
implements
IMailDriver
Table of Contents
Interfaces
- IMailDriver
- Interface IMailDriver
Methods
- send() : bool
- Sends an email to the specified recipient(s).
- setConfig() : void
- Sets the configuration of the driver.
Methods
send()
Sends an email to the specified recipient(s).
public
send(mixed $to, string $from, string|null $from_name, string $subject, string $body, array<string|int, mixed>|null $attachments[, bool $isBodyHtml = true ][, string $charset = "UTF-8" ]) : bool
Parameters
- $to : mixed
-
Mail addresses of the recipients
- $from : string
-
Sender's email address
- $from_name : string|null
-
Sender's name
- $subject : string
-
Subject of the email
- $body : string
-
Body of the email (can be in HTML or plain text format)
- $attachments : array<string|int, mixed>|null
-
Array of filenames of attachments to be sent with the email
- $isBodyHtml : bool = true
-
True if the body is in HTML format, false if it is in plain text format
- $charset : string = "UTF-8"
-
Charset for content encoding
Return values
bool —True if the email was sent successfully, false otherwise
setConfig()
Sets the configuration of the driver.
public
setConfig(array<string|int, mixed> $config) : void
Parameters
- $config : array<string|int, mixed>
-
Configuration array