adeboyed / laravel-ews-driver
为 Laravel 添加 Exchange Web Services 邮件支持。
v1.1.2
2020-09-01 21:36 UTC
Requires
- php: >=7.1
- php-ews/php-ews: ^1.0
Requires (Dev)
- phpunit/phpunit: 6.*
This package is auto-updated.
Last update: 2024-09-29 06:02:42 UTC
README
一个支持 Exchange Web Services 的邮件驱动,使用原始 Laravel API。这个库扩展了原始 Laravel 类,因此使用完全相同的方法。此包需要访问 EWS 主机。
此库使用 php-ews 库来连接到 Exchange Web Services 主机。因此需要以下依赖项
- Composer
- PHP 5.4 或更高版本
- cURL 具有NTLM支持(推荐使用 7.30.0+)
- Exchange 2007 或更高版本
更多信息,请访问那个 仓库
安装(Laravel)
将包添加到 composer.json 并运行 composer update。
"require": { "adeboyed/laravel-ews-driver": "~1.1" },
或使用 composer 安装
$ composer require adeboyed/laravel-ews-driver
在 config/app.php 中添加 Exchange 服务提供者:(Laravel 5.5+ 使用包自动发现,因此不需要手动添加 ServiceProvider。)
'providers' => [ Adeboyed\LaravelExchangeDriver\ExchangeAddedServiceProvider::class ];
安装(Lumen)
将包添加到 composer.json 并运行 composer update。
"require": { "adeboyed/laravel-ews-driver": "~1.1" },
或使用 composer 安装
$ composer require adeboyed/laravel-ews-driver
在 bootstrap/app.php 中添加 exchange 服务提供者
$app->configure('mail'); $app->configure('services'); $app->register(Adeboyed\LaravelExchangeDriver\ExchangeServiceProvider::class); unset($app->availableBindings['mailer']);
创建邮件配置文件。config/mail.php
<?php return [ 'driver' => env('MAIL_DRIVER', 'exchange'), ];
配置
.env
MAIL_DRIVER=exchange
MAIL_HOST=webmail.example.com
MAIL_USERNAME=examplemail
MAIL_PASSWORD=examplepassword
MAIL_MESSAGE_DISPOSITION_TYPE=SaveOnly|SendAndSaveCopy|SendOnly
config/mail.php (在 Lumen 中使用时,需要创建配置目录和文件,更多信息请参阅此处)
'mailers' => [ 'exchange' => [ 'transport' => 'exchange', 'host' => env('MAIL_HOST'), 'username' => env('MAIL_USERNAME'), 'password' => env('MAIL_PASSWORD'), 'messageDispositionType' => env('MAIL_MESSAGE_DISPOSITION_TYPE') // Optional, default: SendAndSaveCopy ], ],
有关消息处置类型的更多信息,请参阅 此处