PHPackages                             yurunsoft/phpmailer-swoole - 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. yurunsoft/phpmailer-swoole

ActiveLibrary

yurunsoft/phpmailer-swoole
==========================

PHPMailer 支持 Swoole 协程环境

v1.0.2(6y ago)31185.0k—4.9%610LGPL-2.1PHPPHP &gt;=7.0

Since Jul 31Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Yurunsoft/PHPMailer-Swoole)[ Packagist](https://packagist.org/packages/yurunsoft/phpmailer-swoole)[ RSS](/packages/yurunsoft-phpmailer-swoole/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (3)Used By (10)

PHPMailer-Swoole
================

[](#phpmailer-swoole)

[![Latest Version](https://camo.githubusercontent.com/227e7cfba4d3db91c959bc4f203fc0b96947aa2ed886b3a7567d988ca882a944/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f797572756e736f66742f7068706d61696c65722d73776f6f6c652e737667)](https://packagist.org/packages/yurunsoft/phpmailer-swoole)[![Php Version](https://camo.githubusercontent.com/6455456103bcc3f8f07b7bd00c1fb29c57764dfe9205e449e9e441dbc5e44bfe/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d372e302d627269676874677265656e2e737667)](https://secure.php.net/)[![Swoole Version](https://camo.githubusercontent.com/d4c3f444f34cdcff0704eef6f3ca617a2839c9e65b4d16b0c16f05456e687b8c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73776f6f6c652d2533453d342e302e302d627269676874677265656e2e737667)](https://github.com/swoole/swoole-src)[![IMI License](https://camo.githubusercontent.com/ac27369d34bb7d0a6d163dda75a732de009247b2959c9c22bfc5b42ddcc723c7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f597572756e736f66742f5048504d61696c65722d53776f6f6c652e737667)](https://github.com/Yurunsoft/PHPMailer-Swoole/blob/master/LICENSE)

介绍
--

[](#介绍)

这是一个适合用于 Swoole 协程环境下的 PHPMailer。

基于 PHPMailer 6.0 实现 PHPMailer 的 Swoole 协程环境支持，本项目未修改 PHPMailer 源码，理论上兼容 PHPMailer 6.0 及后续版本。

只需要使用 Composer 引入了本项目，PHPMailer 将会自动支持协程化，并且只能运行在 Swoole 协程中！

QQ群：17916227 [![点击加群](https://camo.githubusercontent.com/75b53e353bb9e5064662e185a6d39f4bb88c4e45bd3a1240ddf599525edb6afa/68747470733a2f2f7075622e69647171696d672e636f6d2f7770612f696d616765732f67726f75702e706e67 "点击加群")](https://jq.qq.com/?_wv=1027&k=5wXf4Zq)

使用说明
----

[](#使用说明)

Composer:`"yurunsoft/phpmailer-swoole":"~1.0"`

使用方式和 PHPMailer 并无两样，唯一需要注意的是只支持在 Swoole 协程下运行。

```
go(function(){
	$mail = new PHPMailer; //PHPMailer对象
	$mail->CharSet = 'UTF-8'; //设定邮件编码，默认ISO-8859-1，如果发中文此项必须设置，否则乱码
	$mail->IsSMTP(); // 设定使用SMTP服务
	$mail->SMTPDebug = 0; // 关闭SMTP调试功能
	$mail->SMTPAuth = true; // 启用 SMTP 验证功能
	$mail->SMTPSecure = 'ssl'; // 使用安全协议
	$mail->Host = 'smtp.163.com'; // SMTP 服务器
	$mail->Port = '994'; // SMTP服务器的端口号
	$mail->Username = ''; // SMTP服务器用户名
	$mail->Password = ''; // SMTP服务器密码
	$mail->SetFrom('', ''); // 邮箱，昵称
	$mail->Subject = 'title test';
	$mail->MsgHTML('hello world');
	$mail->AddAddress(''); // 收件人
	$result = $mail->Send();
	if($result)
	{
		var_dump('ok');
	}
	else
	{
		$result = $error = $mail->ErrorInfo;
		var_dump($result);
	}
});
```

更加详细的示例代码请看`test`目录下代码。

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity44

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.9% 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 ~225 days

Total

3

Last Release

2399d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f917bb42280d114c53cebadc2942a13ee03abe14971089f88895e266d637169?d=identicon)[Yurunsoft](/maintainers/Yurunsoft)

---

Top Contributors

[![Yurunsoft](https://avatars.githubusercontent.com/u/20104656?v=4)](https://github.com/Yurunsoft "Yurunsoft (10 commits)")[![wuwu123](https://avatars.githubusercontent.com/u/9794138?v=4)](https://github.com/wuwu123 "wuwu123 (1 commits)")

---

Tags

coroutinephpmailerswoole

### Embed Badge

![Health badge](/badges/yurunsoft-phpmailer-swoole/health.svg)

```
[![Health](https://phpackages.com/badges/yurunsoft-phpmailer-swoole/health.svg)](https://phpackages.com/packages/yurunsoft-phpmailer-swoole)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.4k37.3k](/packages/matomo-matomo)[simplesamlphp/simplesamlphp

A PHP implementation of a SAML 2.0 service provider and identity provider.

1.1k12.4M193](/packages/simplesamlphp-simplesamlphp)[getkirby/cms

The Kirby core

1.5k535.5k352](/packages/getkirby-cms)[saithink/saiadmin

webman plugin

2709.9k1](/packages/saithink-saiadmin)[jelix/jelix

Jelix PHP framework

83101.5k4](/packages/jelix-jelix)[doppar/framework

The Doppar Framework

366.7k8](/packages/doppar-framework)

PHPackages © 2026

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