PHPackages                             ceus-media/mail - 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. ceus-media/mail

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

ceus-media/mail
===============

2.7.0(1y ago)02.9k↓66.7%2GPL-3.0-or-laterPHPPHP ^8.1

Since May 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/CeusMedia/Mail)[ Packagist](https://packagist.org/packages/ceus-media/mail)[ RSS](/packages/ceus-media-mail/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (14)Versions (44)Used By (2)

Ceus Media Mail Library
=======================

[](#ceus-media-mail-library)

Produce, send and read mails using PHP + IMAP &amp; SMTP.

[![Latest Stable Version](https://camo.githubusercontent.com/13d4376340be2acc133fb4dbffb6a5b89cdad5be706af1652d3e4cd20abeeb35/68747470733a2f2f706f7365722e707567782e6f72672f636575732d6d656469612f6d61696c2f76)](//packagist.org/packages/ceus-media/mail)[![Total Downloads](https://camo.githubusercontent.com/8e45bff890ae4663584a6f0d89af7bc1add132dcd0a18e2e103e0e3267dbe258/68747470733a2f2f706f7365722e707567782e6f72672f636575732d6d656469612f6d61696c2f646f776e6c6f616473)](//packagist.org/packages/ceus-media/mail)[![License](https://camo.githubusercontent.com/3628eec5776e00cc39828522d811e219e8c6a33c8955cd0fa2723050895b63c8/68747470733a2f2f706f7365722e707567782e6f72672f636575732d6d656469612f6d61696c2f6c6963656e7365)](//packagist.org/packages/ceus-media/mail)[![PHPStan Enabled](https://camo.githubusercontent.com/441b5874ce4df0a2defc892979c96c46889b69cb32119d04f0b48626349f8bc9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d656e61626c65642d627269676874677265656e2e7376673f7374796c653d666c6174)](https://phpstan.org/)

---

Features
--------

[](#features)

- Programming
    - simple, easy, clean
    - PHP 7.3+, object oriented style, chainable
    - automatic encoding
    - automatic MIME type detection
- MIME Contents
    - HTML
    - plain text
    - file attachments
    - inline images
- Partipicants
    - To, Cc, Bcc
    - sender and receiver names
- Transports
    - SMTP, with TLS support
    - local PHP mail function
- Mailbox
    - access via IMAP and POP3
    - search with criteria
- Checks
    - address validity
    - receiver reachability

Code Examples
-------------

[](#code-examples)

### Short version

[](#short-version)

This example shows how to send a text mail using chainability.

```
\CeusMedia\Mail\Transport\SMTP::getInstance("example.com", 587)
	->setAuth("john@example.com", "my_password")
	->send(\CeusMedia\Mail\Message::getInstance()
		->setSender("john@example.com", "John Doe")
		->addRecipient("mike@example.com", "Mike Foo")
		->setSubject("This is just a test")
		->addText("Test Message...")
	);
```

### Long version

[](#long-version)

```
use \CeusMedia\Mail\Message;
use \CeusMedia\Mail\Transport\SMTP;

$message	= new Message();
$message->setSender("john@example.com", "John Doe");
$message->addRecipient("mike@example.com", "Mike Foo");
$message->addRecipient("log@example.com", NULL, 'cc');
$message->addRecipient("spy@example.com", NULL, 'bcc' );

$message->setSubject("This is just a test");
$message->addText("Test Message...");
$message->addHTML('Test Message');
$message->addInlineImage("logo", "logo.png");
$message->addFile("readme.md");

$transport	= new SMTP("example.com", 587);
$transport->setUsername("john@example.com");
$transport->setPassword("my_password");
$transport->setVerbose(TRUE);
$transport->send( $message );
```

Future plans
------------

[](#future-plans)

- documentation for already existing parser
- automatic virus scan
- support for logging
- factories and other design patterns
- slim API - see "Future version"

### Future version

[](#future-version)

Sending a mail should be as easy as possible. This is an outlook how the interface could look like in future.

**Attention:** This is pseudo code. The used classes are not implemented yet.

```
use \CeusMedia\Mail\Client;

Client::getInstance("This is just a test")
	->from("john@example.com", "John Doe")
	->to("mike@example.com", "Mike Foo")
	->bcc("spy@example.com")
	->text("Test Message...")
	->auth("my_password")
	->port(587),
	->error("handleMailException")
	->send();

function handleMailException( $e ){
//  ...
}
```

#### Thoughts on this example

[](#thoughts-on-this-example)

- Sending mail with this short code will be using SMTP, only.
- The SMTP server will be determined by fetching MX records of the user's domain.
- Setting the SMTP server port is still needed.
- Assigned receivers will be checked for existance automatically.
- If the auth method is receiving only one parameter, it will be understood as password.
- The auth username will be taken from sender address.
- Thrown exceptions can be catched by a defined error handler.
- If everything is set the mail can be sent.

#### Good to know

[](#good-to-know)

##### Using Google as SMTP

[](#using-google-as-smtp)

Google tried to protect its SMTP access by several measures. If you are [having problems](https://support.google.com/accounts/answer/6009563) sending mails using Google SMTP, tried [these steps](https://serverfault.com/a/745666):

1. Open a browser an log into Google using a Google account.
2. [Allow "less secure apps"](https://www.google.com/settings/security/lesssecureapps) to have access.
3. [Allow app](https://accounts.google.com/DisplayUnlockCaptcha) to have access.
4. Try again!

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance41

Moderate activity, may be stable

Popularity18

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 95% 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 ~77 days

Recently: every ~37 days

Total

43

Last Release

423d ago

Major Versions

1.2.9 → 2.02019-07-06

1.3.1 → 2.22020-01-03

PHP version history (10 changes)1.0PHP &gt;=5.3.0

1.2.5PHP ^5.3.0 || ^7

2.1PHP ^7.1

2.3.3PHP &gt;=7.1

2.3.4PHP &gt;=7.3

2.4.2PHP &gt;=7.3 | ^8

2.5.2PHP &gt;=7.4 | ^8

2.6.0PHP ^8.1

2.x-devPHP ^7.4 | ^8

2.8.x-devPHP ^8.3

### Community

Maintainers

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

---

Top Contributors

[![kriss0r](https://avatars.githubusercontent.com/u/476914?v=4)](https://github.com/kriss0r "kriss0r (381 commits)")[![cwuerker-c24](https://avatars.githubusercontent.com/u/155151774?v=4)](https://github.com/cwuerker-c24 "cwuerker-c24 (20 commits)")

---

Tags

emailimapimap-checkerimap-librarymailmethod-chainingphpphp81smtpsmtp-clientsmtp-librarysmtp-mailsmtp-protocol

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ceus-media-mail/health.svg)

```
[![Health](https://phpackages.com/badges/ceus-media-mail/health.svg)](https://phpackages.com/packages/ceus-media-mail)
```

###  Alternatives

[minishlink/web-push

Web Push library for PHP

1.9k12.0M53](/packages/minishlink-web-push)[jason-munro/cypht

Lightweight Open Source webmail written in PHP and JavaScript

1.5k146.0k](/packages/jason-munro-cypht)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[netflie/laravel-notification-whatsapp

Laravel notification driver for WhatsApp

176173.9k](/packages/netflie-laravel-notification-whatsapp)

PHPackages © 2026

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