PHPMailer: Email creation and transfer library for PHP
SMTP client and MIME message builder for PHP.
Learn more about PHPMailer
PHPMailer is a PHP class library for creating and sending email messages. It implements SMTP client functionality alongside support for the native mail() function, allowing email delivery across different server configurations. The library handles MIME multipart message construction, character encoding (UTF-8, base64, quoted-printable), attachment management, and email address validation. Common use cases include transactional email in web applications, newsletter delivery, and integration with content management systems and frameworks.
Native SMTP Implementation
Works across all platforms without requiring a local mail server. Supports STARTTLS and SMTPS transports with multiple authentication methods including LOGIN, PLAIN, CRAM-MD5, and XOAUTH2 for flexible deployment.
Comprehensive MIME Support
Constructs properly formatted multipart/alternative messages with inline attachments, iCal events, DKIM signing, and S/MIME signing. Handles complex encoding requirements (UTF-8, base64, quoted-printable) automatically per email standards.
Security-Focused Design
Built-in protections against header injection attacks with automatic email address validation. Includes error handling in 50+ languages and namespacing to prevent naming conflicts in applications.
use Laminas\Mail\Message;
use Laminas\Mail\Transport\Sendmail;
$message = new Message();
$message->setFrom('sender@example.com')
->addTo('recipient@example.com')
->setSubject('Order Confirmation')
->setBody('Your order #12345 has been confirmed.');
$transport = new Sendmail();
$transport->send($message);Major version bump for BC break: `lang()`, `setLanguage()`, and `$language` are now static in child classes.
- –Update child class overrides to declare `lang()`, `setLanguage()`, and `$language` as static methods and properties.
- –Pin to 6.12.0 if you cannot refactor static calls immediately; 6.11.0/6.11.1 changes were reverted there.
Reverts 6.11.x changes that broke child classes; functionally identical to 6.10.0.
- –Pin to 6.12.0 if you extend PHPMailer classes and hit breakage in 6.11.x.
- –Upgrade to 7.0.0 instead if your code depends on features introduced in 6.11.0 or 6.11.1.
Patch release reverting a deprecation regression introduced in 6.11.0; review language-related changes from that prior release.
- –Update restores a previously deprecated argument that was incorrectly removed in 6.11.0.
- –Check 6.11.0 release notes for language-related breaking changes if upgrading from earlier versions.
See how people are using PHPMailer
Top in Backend & APIs
Related Repositories
Discover similar tools and frameworks used by developers
rails
Convention-driven Ruby framework for full-stack web applications.
erpnext
Full-featured ERP system built on Frappe Framework.
axios
Promise-based HTTP client with unified browser and Node.js interface.
express
Middleware-based HTTP routing and response handling for Node.js.
dompdf
CSS 2.1 compliant HTML layout and rendering engine.