PHPackages                             smalot/sendmail-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. [Mail &amp; Notifications](/categories/mail)
4. /
5. smalot/sendmail-smtp

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

smalot/sendmail-smtp
====================

Sendmail wrapper to send mail via SMTP

v0.2.0(9y ago)12253MITPHP

Since Jan 13Pushed 8y ago2 watchersCompare

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

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

Sendmail SMTP
=============

[](#sendmail-smtp)

[![Latest Stable Version](https://camo.githubusercontent.com/3d60b590b5c976fb6b57300f6b62b01854dee3848cf1f1edd0d84a4384fa003b/68747470733a2f2f706f7365722e707567782e6f72672f736d616c6f742f73656e646d61696c2d736d74702f762f737461626c65)](https://packagist.org/packages/smalot/sendmail-smtp)[![Latest Unstable Version](https://camo.githubusercontent.com/970708e75f8331b0317afc4b9fb2bb64bd1b332937825c2294c140be4f90032b/68747470733a2f2f706f7365722e707567782e6f72672f736d616c6f742f73656e646d61696c2d736d74702f762f756e737461626c65)](https://packagist.org/packages/smalot/sendmail-smtp)[![License](https://camo.githubusercontent.com/1b011c8c1701c57cb8738c2accb8835b3a20d002a9de9c46b745307ab761950a/68747470733a2f2f706f7365722e707567782e6f72672f736d616c6f742f73656e646d61696c2d736d74702f6c6963656e7365)](https://packagist.org/packages/smalot/sendmail-smtp)[![composer.lock](https://camo.githubusercontent.com/3cccf00e5804521296717ca632a4b5494e3b3fddcaf83e2ce793c10c87868353/68747470733a2f2f706f7365722e707567782e6f72672f736d616c6f742f73656e646d61696c2d736d74702f636f6d706f7365726c6f636b)](https://packagist.org/packages/smalot/sendmail-smtp)

[![Total Downloads](https://camo.githubusercontent.com/7eaf3545c6a2582f8110bda72f0312ac03bcfaa55673627929eafa69a1b27610/68747470733a2f2f706f7365722e707567782e6f72672f736d616c6f742f73656e646d61696c2d736d74702f646f776e6c6f616473)](https://packagist.org/packages/smalot/sendmail-smtp)[![Monthly Downloads](https://camo.githubusercontent.com/8675be319ee1b483571e6e4d8b1ded79e85f414d77543391f223360b7644ddc0/68747470733a2f2f706f7365722e707567782e6f72672f736d616c6f742f73656e646d61696c2d736d74702f642f6d6f6e74686c79)](https://packagist.org/packages/smalot/sendmail-smtp)[![Daily Downloads](https://camo.githubusercontent.com/973a499feaad1d7abff2e0deabacfef100ae1c94864bca0d7e1d16847fbedef6/68747470733a2f2f706f7365722e707567782e6f72672f736d616c6f742f73656e646d61696c2d736d74702f642f6461696c79)](https://packagist.org/packages/smalot/sendmail-smtp)

PHP wrapper which replace default `/usr/sbin/sendmail` to add `smtp` support.

Add `smtp` support for basic `mail` function.

Setup
=====

[](#setup)

Download command line tool
--------------------------

[](#download-command-line-tool)

First, download the last release of the binary:

```
wget https://github.com/smalot/sendmail-smtp/releases/download/v0.1.0/sendmail.phar
```

And enable execution flag

```
chmod +x sendmail.phar
```

Check if it works by displaying version

```
./sendmail.phar list
```

Update `php.ini`
----------------

[](#update-phpini)

Edit the `cli`, `apache` or both `php.ini` files.

```
# Set the full path to the phar command line tool.
sendmail_path = "/path/to/phar/sendmail.phar"
```

The [`sendmail_path`](http://php.net/manual/en/ini.list.php) is a **[PHP\_INI\_SYSTEM](http://php.net/manual/en/configuration.changes.modes.php)** `changeable` type which means you can only change it in the `php.ini` file or in the `httpd.conf` file.

Config file
===========

[](#config-file)

File to store config : `/etc/sendmail-smtp.yml`.

You can however place the config file in another folder by specifying it in the `sendmail_path` value.

```
sendmail_path = "/path/to/phar/sendmail.phar -f /config/folder/sendmail.yml"
```

Full details
------------

[](#full-details)

```
# SMTP hosts.
# Either a single hostname or multiple semicolon-delimited hostnames.
# You can also specify a different port
# for each host by using this format: [hostname:port]
# (e.g. "smtp1.example.com:25;smtp2.example.com").
# You can also specify encryption type, for example:
# (e.g. "tls://smtp1.example.com:587;ssl://smtp2.example.com:465").
# Hosts will be tried in order.
host: 127.0.0.1

# The default SMTP server port.
port: 25

# Whether to use SMTP authentication.
# Uses the Username and Password properties.
auth: false

# SMTP username.
username: ~

# SMTP password.
password: ~

# SMTP auth type.
# Options are CRAM-MD5, LOGIN, PLAIN, NTLM, XOAUTH2, attempted in that order if not specified.
auth_type: ~

# What kind of encryption to use on the SMTP connection.
# Options: '', 'ssl' or 'tls'
secure: ~

# Whether to enable TLS encryption automatically if a server supports it,
# even if `secure` is not set to 'tls'.
# Be aware that in PHP >= 5.6 this requires that the server's certificates are valid.
auto_tls: ~

# SMTP realm.
# Used for NTLM auth
realm: ~

# SMTP workstation.
# Used for NTLM auth
workstation: ~

# The SMTP server timeout in seconds.
# Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
timeout: 300

# Options array passed to stream_context_create when connecting via SMTP.
# @see http://nl1.php.net/manual/en/function.stream-context-create.php
options: ~

# SMTP class debug output mode.
# Debug output level.
# Options:
# * `0` No output
# * `1` Commands
# * `2` Data and commands
# * `3` As 2 plus connection status
# * `4` Low-level data output
debug: 0
```

Sample config files
===================

[](#sample-config-files)

Gmail
-----

[](#gmail)

```
host: smtp.gmail.com
port: 587
username: mail@example.tld
password: xxxxxxxxxx
auth: true
```

1and1
-----

[](#1and1)

```
host: smtp.1und1.de
port: 587
username: mail@example.tld
password: xxxxxxxxxx
auth: true
```

SMTP Server Docker
------------------

[](#smtp-server-docker)

```
host: 127.0.0.1
port: 8025
auth: false
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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 ~0 days

Total

2

Last Release

3403d ago

### Community

Maintainers

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

---

Top Contributors

[![smalot](https://avatars.githubusercontent.com/u/1424035?v=4)](https://github.com/smalot "smalot (5 commits)")[![phishy](https://avatars.githubusercontent.com/u/26844?v=4)](https://github.com/phishy "phishy (1 commits)")

---

Tags

eventsmtpsendmail

### Embed Badge

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

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

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[silverstripe/framework

The SilverStripe framework

7213.5M2.5k](/packages/silverstripe-framework)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

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

Drupal is an open source content management platform powering millions of websites and applications.

19462.3M1.3k](/packages/drupal-core)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

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