Download the PHP package edward144/php-mailer-failover without Composer
On this page you can find all versions of the php package edward144/php-mailer-failover. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download edward144/php-mailer-failover
More information about edward144/php-mailer-failover
Files in edward144/php-mailer-failover
Package php-mailer-failover
Short Description A PHP Mailer class that allows for multiple redundant SMTP services to be configured.
License MIT
Informations about the package php-mailer-failover
PHPMailer Failover
A PHPMailer class that allows for the configuration of multiple redundant SMTP services. Each service is attempted in turn and if it fails then the next is used. If all services fail then the mail will be logged to a local file for debugging and so that the mail is not lost.
Installation
This package is now on Packagist, so you can simply run composer require edward144/php-mailer-failover
.
Create a composer.json file or amend your existing one. Add this Github repository and require the latest version.
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/Edward144/PHPMailer-Failover.git"
}
],
"require": {
"edward144/php-mailer-failover": "^1.0"
},
"minimum-stability": "stable"
}
Run composer install
Configuration
A number of constants must be defined for the class to operate. An example of these can be found within tests/config.example.php. These should be stored in a secure location as your SMTP credentials are required.
-
MAILER_FAILOVER_SMTP
- an array of SMTP services to use, these will be attempted in order. MAILER_FAILOVER_DEBUG_LEVEL
- an integer debug level as defined by PHPMailer, default is 2- 0 - Debug off
- 1 - Client to Server messages
- 2 - As 1 plus Server to Client messages
- 3 - As 2 plus connection status
- 4 - All messages
MAILER_FAILOVER_DEBUG_LOCATION
- the absolute path to the location where debug logs and failed mails will be stored, include a trailing slashMAILER_FAILOVER_FROM
- the default email address that mail will be sent fromMAILER_FAILOVER_FROM_FRIENDLY
- the default friendlt name that mail will be sent from
Usage
Include the class, require vendor/autoload.php and include your defined constants.
You can then add utilize a variety of methods to configure your mail.