smtp2go-oss/smtp2go-laravel
最新稳定版本:1.0.1
Composer 安装命令:
composer require smtp2go-oss/smtp2go-laravel
包简介
README 文档
README
This is a Laravel Service Provider for sending mail from a Laravel application via SMTP2GO. It should also work in Symfony applications due to Laravel's underlying dependency on Symfony mailer.
Requirements
- PHP 8.2 or higher
- Laravel 11.0 or higher
- SMTP2GO account
Install
Install via composer:
composer require smtp2go-oss/smtp2go-laravel
Setup - Laravel
- Set up environment variables:
Add the following entry to your .env file with your SMTP2GO api key.
SMTP2GO_API_KEY=api-YOUR_API_KEY_HERE
and change the existing MAIL_MAILER entry to smtp2go
MAIL_MAILER=smtp2go
- Add the following entry to config/mail.php
'smtp2go' => [ 'key' => env('SMTP2GO_API_KEY'), 'transport' => 'smtp2go', ]
Setup - Symfony
- Add the following to your
.envfile
SMTP2GO_API_KEY=api-YOUR_API_KEY_HERE
MAILER_DSN=SMTP2GO://${SMTP2GO_API_KEY}@default
- If not already configured, import a services.php file in the
config/services.yamlfile
imports:
- { resource: 'services.php' }
- Setup
config/services.php, example below...
<?php //config/services.php namespace Symfony\Component\DependencyInjection\Loader\Configurator; use SMTP2GO\Transport\SMTP2GOTransportFactory; return function (ContainerConfigurator $container): void { $services = $container->services(); //if you already have a services.php file set up, you just //need to add this line... $services->set(SMTP2GOTransportFactory::class) ->tag('mailer.transport_factory'); };
Contributing
Contributions are welcome! Please submit a pull request or open an issue to discuss changes.
License
This project is licensed under the MIT License.
Contact
For any questions or support, please contact SMTP2GO.
统计信息
- 总下载量: 1.72k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-05-21