Mail::__construct
Create a new email
Description
public Mail::__construct( [ string $subject = null, string $body = null, array $header = null ] )
Arguments
| Name | Data type | Default | Remarks |
|---|---|---|---|
| $subject | string | null | Email subject |
| $body | string | null | Email body (plain text) |
| $header | array | null | Custom headers, passed to Mail::pushHeader |
Example
Controller
use Fegg\Tool\Mail;
$mail = new Mail('Mail subject', 'Mail body');
// Same with
$mail = new Mail();
$mail->subject('Mail subject');
$mail->body('Mail body');