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);This maintenance release fixes sendmail parameter issues in WordPress and reduces memory usage when sending large attachments.
- –Fixes for sendmail parameter problems in WordPress
- –Reduce memory consumption when sending large attachments
Adds PHP 8.5 support, improves XOAUTH2 exception handling, switches to modern IMAP library, and updates language translations.
- –Use From domain when generating CIDs in msgHTML
- –Update to PHPCompatibility 10, resolve numerous PHPCS issues in PHP 8.5
- –Revise GitHub actions for PHP 8.5 and experimental 8.6 tests
- –Switch gmail example from deprecated IMAP extension to directorytree/imapengine for IMAP uploads
- –Set htmlspecialchars() flags explicitly and consistently
Introduces breaking changes by making language-related methods and properties static, requiring static calls in child classes.
- –This is exactly the same as version 6.11.1 but bumps the major version number to indicate the presence of a BC break in child classes
- –The changes in 6.11.0 and 6.11.1 have been reverted in 6.12.0
Top in Backend & APIs
Related Repositories
Discover similar tools and frameworks used by developers
Ruby on Rails
Convention-driven Ruby framework for full-stack web applications.
Discourse
Self-hostable forum platform with Ruby on Rails, real-time chat, and plugin support.
ioredis
Robust TypeScript Redis client supporting clusters and Sentinel.
Laravel
Full-stack PHP framework with ORM and dependency injection.
Magento 2
Modular PHP platform for self-hosted ecommerce storefronts.