PHPackages                             gaswelder/smtp - 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. gaswelder/smtp

ActiveLibrary

gaswelder/smtp
==============

SMTP client

0.9.0(8y ago)018MITPHP

Since Sep 1Pushed 8y ago1 watchersCompare

[ Source](https://github.com/gaswelder/php-smtp)[ Packagist](https://packagist.org/packages/gaswelder/smtp)[ RSS](/packages/gaswelder-smtp/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

SMTP client
===========

[](#smtp-client)

This client speaks SMTP protocol to deliver messages. This makes it possible to:

- send mail from where normal mail functions are not working;
- send the message to many recipients in one call.

Basic usage example
-------------------

[](#basic-usage-example)

```
use gaswelder\smtp\Client;
use gaswelder\smtp\Mail;

$mail = new Mail();
$mail->subject = "Hey there";
$mail->body = ";)";

$returnPath = "bob@example.net";
$destinationPath = "alice@example.net";

$smtp = new Client();
$smtp->connect("smtp.example.net");
$smtp->login("bob", "****");
$smtp->send($mail, $returnPath, $destinationPath);
```

Mail list example
-----------------

[](#mail-list-example)

```
use gaswelder\smtp\Client;
use gaswelder\smtp\Mail;

$mail = new Mail();
$mail->to = "To whom it might concern";
$mail->subject = "Viagra!";
$mail->body = ";)";

$recipients = [
	"phb@fortune.com",
	"bob@example.net",
	"bill@example.net"
];
$smtp = new Client();
$smtp->connect("mail.net");
$smtp->login("mailer", "****");
$smtp->send($mail, "mailer@mail.net", $recipients);
```

SSL
---

[](#ssl)

The client always uses SSL (`STARTTLS`) before logging in. It's possible to tweak the SSL parameters by defining the `ssl` option to a map of SSL context options according to . For example, to allow self-signed certificates:

```
$client = new Client([
	'ssl' => [
		'allow_self_signed' => true
	]
]);
```

Logging
-------

[](#logging)

To get log messages (which include client and server messages sent over the connection) define the `logger` option to be a callable accepting the log line:

```
$client = new Client([
	'logger' => function($line) {
		fwrite(STDERR, $line."\n");
	}
]);
```

Installation
------------

[](#installation)

```
composer require gaswelder/smtp

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

Unknown

Total

1

Last Release

3173d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e2448795e31018c6343d5ce0250660f3f49a30965826ab032e629577f4b2d462?d=identicon)[gaswelder](/maintainers/gaswelder)

---

Top Contributors

[![gaswelder](https://avatars.githubusercontent.com/u/5239895?v=4)](https://github.com/gaswelder "gaswelder (30 commits)")

### Embed Badge

![Health badge](/badges/gaswelder-smtp/health.svg)

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

PHPackages © 2026

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