PHPackages                             xiaosongshu/mail - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. xiaosongshu/mail

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

xiaosongshu/mail
================

发送邮件客户端

v1.1.0(11mo ago)1111MITPHPPHP &gt;=7.0

Since Dec 21Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/2723659854/mail)[ Packagist](https://packagist.org/packages/xiaosongshu/mail)[ RSS](/packages/xiaosongshu-mail/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (7)Used By (1)

### 邮件发送

[](#邮件发送)

#### 插件说明

[](#插件说明)

本插件支持批量发送邮件，支持发送附件。
使用本插件发送邮件，不需要申请模板，不需要审核内容，不限制文件大小（尽量不要发送过大的附件，文件越大，耗时越久）。
本插件支持php-cli模式运行，支持php-fpm模式运行。

#### 安装

[](#安装)

```
composer require xiaosongshu/mail
```

#### 开启smtp服务 并获取授权码

[](#开启smtp服务-并获取授权码)

登录到你的邮箱，设置开启smtp服务。一般在邮箱的设置，账户，smtp里面。

```

    QQ邮箱：https://service.mail.qq.com/detail/0/75
    网易163邮箱：https://help.mail.163.com/faq.do?m=list&categoryID=90
    新浪邮箱：https://help.sina.com.cn/comquestiondetail/view/1566/
    其他...

```

#### 发送邮件

[](#发送邮件)

```
/** 发件人 你的邮箱地址 */
$user = 'xxxxxxx@qq.com';
/** 发件人授权码 在邮箱的设置，账户，smtp里面  */
$password = 'xxxxxxxx';
/** 邮箱服务器地址 */
$url = 'smtp.qq.com:25';

try {
    /** 实例化客户端 */
    $client = new \Xiaosongshu\Mail\Client();
    /** 配置服务器地址 ，发件人信息 */
    $client->config($url, $user, $password);
    /** 发送邮件 语法：[收件人邮箱] ,邮件主题, 邮件正文,[附件]  */
    $res = $client->send( ['xxxx@qq.com'],'标题', '正文呢',[__DIR__.'/favicon.ico',__DIR__.'/favicon2.ico',]);
    print_r($res);
} catch (Exception $exception) {
    print_r("发送邮件失败");
    print_r($exception->getMessage());
}
```

#### 联系作者

[](#联系作者)

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance51

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~116 days

Recently: every ~145 days

Total

6

Last Release

344d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/17f593cfd6a2e0845ea319086175a4d2173229dd598bf9f67575911fb3497f2b?d=identicon)[2723659854](/maintainers/2723659854)

---

Top Contributors

[![2723659854](https://avatars.githubusercontent.com/u/43638463?v=4)](https://github.com/2723659854 "2723659854 (7 commits)")

### Embed Badge

![Health badge](/badges/xiaosongshu-mail/health.svg)

```
[![Health](https://phpackages.com/badges/xiaosongshu-mail/health.svg)](https://phpackages.com/packages/xiaosongshu-mail)
```

###  Alternatives

[maize-tech/laravel-email-domain-rule

Laravel Email Domain Rule

612.0k](/packages/maize-tech-laravel-email-domain-rule)[sarfraznawaz2005/noty

Laravel package to incorporate noty flash notifications into laravel.

324.5k](/packages/sarfraznawaz2005-noty)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
