dotkernel/dot-mail-outlook 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dotkernel/dot-mail-outlook

最新稳定版本:0.3

Composer 安装命令:

composer require dotkernel/dot-mail-outlook

包简介

Dotkernel Dot-Mail Outlook ESMTP service.

README 文档

README

Dotkernel's Microsoft Outlook ESMTP email service, implementing the client credentials grant_type.

dot-mail-outlook is a wrapper on top of dotkernel/dot-mail

Badges

OSS Lifecycle PHP from Packagist (specify version)

GitHub issues GitHub forks GitHub stars GitHub license

Build Static codecov PHPStan

Installation

Install dotkernel/dot-mail-outlook by executing the following Composer command:

composer require dotkernel/dot-mail-outlook

Register src/ConfigProvider.php in config/config.php by adding the following line:

\Dot\MailOutlook\ConfigProvider::class,

Configuration

Copy the dot-mail-outlook.local file to your autoload folder (or copy its contents to mail.global.php) and fill in the relevant information.

<?php

declare(strict_types=1);

$tenant = '';

return [
    'xoauth2_outlook' => [
        "tokenCacheFile"  => '',
        "tenant"          => $tenant,
        "access_code_url" => "https://login.microsoftonline.com/{$tenant}/oauth2/v2.0/token",
        "client_id"       => '',
        "client_secret"   => '',
        "scope"           => 'https://outlook.office.com/.default',
        "grant_type"      => 'client_credentials',
    ],
];

The dotkernel/dot-mail config file should be updated to make sure the necessary options are set:

  • transport MUST be set to under the dot_mail.default.transport key.
  • port MUST be set to 587 under the dot_mail.default.smtp_options.port key.
  • tls MUST be set to STARTTLS under the dot_mail.default.smtp_options.tls key.
  • host MUST be one of smtp-mail.outlook.com or smtp.office365.com under the dot_mail.default.smtp_options.host key.

Additional info

dotkernel/dot-mail-outlook makes use of SASL XOAUTH2 mechanism for use with the SMTP AUTH command.

To allow generating the bearer token in the background, without a user input required, dot-mail-outlook implements the client credentials flow from Microsoft:

Make sure to set all relevant permissions, give relevant tenant administrator consent and register the necessary service principals, as described in Microsoft's flow.

统计信息

  • 总下载量: 436
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-08-18