aselsan/codeigniter4-multi-smtp-config
Composer 安装命令:
composer require aselsan/codeigniter4-multi-smtp-config
包简介
CodeIgniter Multiple SMTP Configuration
README 文档
README
A lightweight Multi-SMTP configuration helper for your CodeIgniter 4 application. This package allows you to use different email accounts simultaneously.
Installation
composer require aselsan/codeigniter4-multi-smtp-config
Publish File Config
php spark smtpconfig:publish
After that, check the app/Config/MultiEmail.php file, and set it up with your email credentials.
Configuring SMTP in the .env File
We recommend setting the configuration for each SMTP email in the .env file instead of using app/Config/MultiEmail.php.
For example, you can proceed as follows:
#--------------------------------------------------------------------
# MULTI-SMTP CONFIGURATION SETTINGS
#--------------------------------------------------------------------
# email.default.fromName =
# email.default.fromEmail =
# email.default.protocol = smtp
# email.default.SMTPUser =
# email.default.SMTPPass =
# email.default.SMTPHost = smtp.gmail.com
# email.default.SMTPPort = 587
# email.outlook.fromName =
# email.outlook.fromEmail =
# email.outlook.protocol = smtp
# email.outlook.SMTPUser =
# email.outlook.SMTPPass =
# email.outlook.SMTPHost = smtp.office365.com
# email.outlook.SMTPPort = 587
Usage
helper('multi_email'); $email = multi_email(['mailType' => 'html']); $email->setTo('example@gmail.com'); $email->setSubject("Test Send Mail"); $email->setMessage('Hi, Bonjour'); if ($email->send(false) === false) { throw new Exception('Cannot send email:' . $email->printDebugger(['headers'])); } // Clear the email $email->clear();
You can use a different mail config by providing the group name in the second parameter.
helper('multi_email'); $email = multi_email(['mailType' => 'html'], 'outlook'); $email->setTo('example@gmail.com'); $email->setSubject("Test Send Mail"); $email->setMessage('Hi, Bonjour'); if ($email->send(false) === false) { throw new Exception('Cannot send email:' . $email->printDebugger(['headers'])); } // Clear the email $email->clear();
License
This project is licensed under the MIT License - see the LICENSE file for details.
aselsan/codeigniter4-multi-smtp-config 适用场景与选型建议
aselsan/codeigniter4-multi-smtp-config 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 68 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 08 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 aselsan/codeigniter4-multi-smtp-config 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 aselsan/codeigniter4-multi-smtp-config 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 68
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-08-30