PHPackages                             vivlong/phalapi-xmailer - 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. vivlong/phalapi-xmailer

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

vivlong/phalapi-xmailer
=======================

PhalApi 2.x扩展类库，基于PHPMailer的邮件发送。

0.0.2(5y ago)058MulanPSL-2.0PHPPHP &gt;=7.0.0

Since Mar 11Pushed 3y ago1 watchersCompare

[ Source](https://github.com/vivlong/phalapi-xmailer)[ Packagist](https://packagist.org/packages/vivlong/phalapi-xmailer)[ Docs](https://www.phalapi.net/)[ RSS](/packages/vivlong-phalapi-xmailer/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

PhalApi 2.x 的PHPMailer扩展
========================

[](#phalapi-2x-的phpmailer扩展)

PhalApi 2.x扩展类库，基于PHPMailer的邮件发送，增加自定义端口与发送附件支持。

安装和配置
-----

[](#安装和配置)

修改项目下的composer.json文件，并添加：

```
    "vivlong/phalapi-xmailer":"dev-master"

```

然后执行`composer update`，如果PHP版本过低，可使用`composer update --ignore-platform-reqs`。

安装成功后，添加以下配置到./config/app.php文件：

```
    'Xmailer' => array(
        'email' => array(
            'host' => 'smtp.gmail.com',
            'port' => 465,
            'SMTPSecure' => 'SSL',
            'username' => 'XXX@gmail.com',
            'password' => '******',
            'from' => 'XXX@gmail.com',
            'fromName' => 'PhalApi团队',
            'sign' => '请不要回复此邮件，谢谢！-- PhalApi团队敬上 ',
        ),
    ),
```

注册
--

[](#注册)

在./config/di.php文件中，注册邮件服务：

```
$di->mailer = function() {
    return new \PhalApi\Xmailer\Lite();
};
```

使用
--

[](#使用)

如下代码示例：

```
\PhalApi\DI()->mailer->send('abc@gmail.com', 'Test PHPMailer Lite', 'something here ...');
```

如果需要发送邮件给多个邮箱时，可以使用数组，如：

```
$addresses = array('abc@gmail.com', 'test@phalapi.com');
\PhalApi\DI()->mailer->send($addresses, 'Test PHPMailer Lite', 'something here ...');
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.1% 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 ~639 days

Total

2

Last Release

1976d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/63cebb214330833e8bea309160266105934daf5e70e20db7ae58a6484443f37c?d=identicon)[vivlong](/maintainers/vivlong)

---

Top Contributors

[![vivlong](https://avatars.githubusercontent.com/u/3961154?v=4)](https://github.com/vivlong "vivlong (25 commits)")[![dogstarTest](https://avatars.githubusercontent.com/u/6116306?v=4)](https://github.com/dogstarTest "dogstarTest (6 commits)")[![phalapi](https://avatars.githubusercontent.com/u/12585518?v=4)](https://github.com/phalapi "phalapi (1 commits)")

---

Tags

phalapiphalapi-xmailerxmailer

### Embed Badge

![Health badge](/badges/vivlong-phalapi-xmailer/health.svg)

```
[![Health](https://phpackages.com/badges/vivlong-phalapi-xmailer/health.svg)](https://phpackages.com/packages/vivlong-phalapi-xmailer)
```

###  Alternatives

[ivantcholakov/codeigniter-phpmailer

A CodeIgniter 3 compatible email-library powered by PHPMailer.

25313.9k](/packages/ivantcholakov-codeigniter-phpmailer)[markguinn/silverstripe-email-helpers

Silverstripe extension containing SMTP mailer class and some other classes for HTML emails

3145.4k1](/packages/markguinn-silverstripe-email-helpers)[msp/smtp

SMTP with PHPMailer

2129.4k](/packages/msp-smtp)[nfephp-org/sped-mail

API para geração e envio dos emails relacionados com o SPED.

1123.7k](/packages/nfephp-org-sped-mail)

PHPackages © 2026

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