koldy/phpmailer

Koldy 框架的扩展,用于整合 PHPMailer

0.1.1 2022-05-26 21:28 UTC

This package is auto-updated.

Last update: 2024-09-27 02:22:01 UTC


README

使用此包将 PHPMailer 集成到基于 Koldy 框架的项目中。最低 PHP 版本为 PHP 8.1

composer require koldy/phpmailer

配置

在您项目的配置文件夹中(通常为 configs/mail.php),添加以下代码块

'phpmailer' => [
    'enabled' => true,
    'adapter_class' => \KoldyPHPMailer\PHPMailer::class,
    'options' => [
        'host' => 'your.domain.com',
        'port' => 587,
        'username' => 'your.username',
        'password' => 'your.password',
        'type' => 'smtp',
        'adjust' => function ($phpmailer) { // optional
            // you can adjust the PHPMailer's instance here, for example:
            $phpmailer->SMTPDebug = \PHPMailer\PHPMailer\SMTP::DEBUG_SERVER;
        }
    ]
]

许可证

开源并发布在 MIT 许可证 下。