PhpMail
in package
implements
MailSender
Implement mailer method
TRICKY: Keep this SMTP import it is needed, even when IDE says it is not ^^
Tags
Interfaces, Classes, Traits and Enums
- MailSender
- Define mail sender method
Table of Contents
- $attachments : array<string|int, mixed>
- Buffer for attachments
- $config_file : string
- Path to config file
- $debug : bool
- Enable / Disable debug
- $default_config_file : string
- Path to default settings
- $instance : PHPMailer|null
- Buffer handler Store the mail send abstraction layer
- $preset_file : string
- Path to form preset file
- $settings : stdClass|null
- Store the local config Buffer the local configuration object
- AddAttachment() : bool
- Add an attachment Add attachment to mail
- AddEmbeddedImage() : string|bool
- Add an image Add internal embedded image to this mail
- GetDefaultSettings() : Result
- load defaults load the default settings for this delivery method
- GetFormPreset() : Result
- preset load the common pickup settings preset for generation a form
- GetSettings() : Result
- get load the common pickup settings object
- SendInterface() : Result
- Get the mailer Get the mailer instance and handle further operations
- StoreSettings() : Result
- Save the common pickup settings object
- Subject() : void
- Override the subject before sending
- config() : stdClass
- connect load settings object from local storage
Properties
$attachments
Buffer for attachments
private
array<string|int, mixed>
$attachments
= []
$config_file
Path to config file
private
string
$config_file
= 'mailer.phpmail'
$debug
Enable / Disable debug
private
bool
$debug
= false
$default_config_file
Path to default settings
private
string
$default_config_file
= FAA_PATHS_LIBABS . 'handler/mailer/phpmail.json'
$instance
Buffer handler Store the mail send abstraction layer
private
PHPMailer|null
$instance
= null
A php mailer instance
$preset_file
Path to form preset file
private
string
$preset_file
= FAA_PATHS_LIBABS . 'handler/mailer/phpmail_setup.json'
$settings
Store the local config Buffer the local configuration object
private
stdClass|null
$settings
= null
Configuration object
Methods
AddAttachment()
Add an attachment Add attachment to mail
public
AddAttachment(string $path, string $name) : bool
Parameters
- $path : string
-
Absolute path to file
- $name : string
-
Speaking name
Tags
Return values
bool —The add result
AddEmbeddedImage()
Add an image Add internal embedded image to this mail
public
AddEmbeddedImage(string $path, string $id) : string|bool
Parameters
- $path : string
-
Absolute path to file
- $id : string
-
Reference id
Tags
Return values
string|bool —The add result
GetDefaultSettings()
load defaults load the default settings for this delivery method
public
GetDefaultSettings() : Result
Tags
Return values
Result —$result A system result object
GetFormPreset()
preset load the common pickup settings preset for generation a form
public
GetFormPreset() : Result
Tags
Return values
Result —$result A system result object
GetSettings()
get load the common pickup settings object
public
GetSettings() : Result
Tags
Return values
Result —$result A system result object
SendInterface()
Get the mailer Get the mailer instance and handle further operations
public
SendInterface(Email $mail) : Result
Parameters
- $mail : Email
-
Set the mail to send
Tags
Return values
Result —The send result via interface
StoreSettings()
Save the common pickup settings object
public
StoreSettings(object $values) : Result
Parameters
- $values : object
-
The configuration values
Tags
Return values
Result —$result A system result object
Subject()
Override the subject before sending
public
Subject(string $subject) : void
Parameters
- $subject : string
Tags
Return values
void —config()
connect load settings object from local storage
private
config() : stdClass