struktal / struktal-phpmailer-wrapper
PHP wrapper library to extract common settings for a PHPMailer object instance
Installs: 309
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 1
pkg:composer/struktal/struktal-phpmailer-wrapper
Requires
- php: >=8.2.0
- phpmailer/phpmailer: ^6.10.0
This package is auto-updated.
Last update: 2025-10-17 03:23:34 UTC
README
This is a PHP wrapper library to extract common settings for a PHPMailer object instance
Installation
To install this library, include it in your project using Composer:
composer require struktal/struktal-phpmailer-wrapper
Usage
Before you can use this library, you need to customize a few parameters. You can do this in the startup of your application:
\struktal\MailWrapper\MailWrapper::setSetupFunction(function(\struktal\MailWrapper\MailWrapper $mailer) { // Set up the mailer instance here });
Furthermore, you can specify to redirect all mails to a specific address instead of the real recipients for testing purposes:
\struktal\MailWrapper\MailWrapper::setRedirectAllMails( true, "email@domain.com" // The email address to redirect all mails to );
Then, you can instantiate an instance of the MailWrapper class and use it just like a regular PHPMailer object for sending mails.
Dependencies
- PHPMailer - GitHub: PHPMailer/PHPMailer, licensed under LGPL-2.1 license
License
This software is licensed under the LGPL-2.1 license. See the LICENSE file for more information.