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. [HTTP &amp; Networking](/categories/http)
4. /
5. gaswelder/smtp

ActiveLibrary[HTTP &amp; Networking](/categories/http)

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 2w 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 31% 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

3223d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5239895?v=4)[Alexey Liplianin](/maintainers/gaswelder)[@gaswelder](https://github.com/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)
```

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25025.5M80](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.2M6.6k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k20.0k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87930.4k113](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.3M84](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69122.6k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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