Repository navigation
Installation
github-actions[bot] edited this page Nov 22, 2026
·
2 revisions
| Requirement | Notes |
|---|---|
| PHP 8.2 or newer | The library is fully typed; 8.2 is the supported minimum. |
ext-mbstring |
Byte-accurate string handling for encoding and line wrapping. |
ext-iconv |
RFC 2047 header (Q) encoding. |
ext-fileinfo |
MIME-type detection for attachments. |
These extensions ship with most PHP builds. You can confirm they are enabled:
php -m | grep -E 'mbstring|iconv|fileinfo'To actually deliver mail you also need one of:
- a working
mail()setup (an MTA configured inphp.ini), - a local sendmail binary, or
- access to an SMTP server.
See Transports for how to choose.
composer require initphp/mailerThat's the whole installation — there are no runtime dependencies beyond the PHP extensions above.
<?php
require 'vendor/autoload.php';
use InitPHP\Mailer\Mailer;
$mailer = Mailer::newInstance();
var_dump($mailer->isValidEmail('you@example.com')); // bool(true)If that prints bool(true), autoloading and the install are fine. Continue to
the Quick Start.
Everything lives under the InitPHP\Mailer\ namespace and is autoloaded via
PSR-4:
| Namespace | Contains |
|---|---|
InitPHP\Mailer |
Mailer, MailerConfig
|
InitPHP\Mailer\Facade |
the static Mailer facade |
InitPHP\Mailer\Exception |
MailerException and its subtypes |
InitPHP\Mailer\Transport |
the transport interface and implementations |
InitPHP\Mailer\Message |
Address, Attachment, value objects |
InitPHP\Mailer\Encoding |
header and body encoders |
initphp/mailer · MIT License · part of the InitPHP family
Source · Issues · Discussions · Packagist · Contributing · Security Policy
Getting Started
Sending
Reliability
Reference
Migration