PHPackages                             rusinov-artem/phpmailer - 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. rusinov-artem/phpmailer

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

rusinov-artem/phpmailer
=======================

PHPMailer is a full-featured email creation and transfer class for PHP

v6.10.0(11mo ago)09LGPL-2.1-onlyPHPPHP &gt;=5.5.0

Since May 21Pushed 11mo agoCompare

[ Source](https://github.com/rusinov-artem/PHPMailer)[ Packagist](https://packagist.org/packages/rusinov-artem/phpmailer)[ Fund](https://pay.mysbertips.ru/12247718)[ RSS](/packages/rusinov-artem-phpmailer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (8)Versions (3)Used By (0)

[![PHPMailer](https://camo.githubusercontent.com/9cb2da7fa70cc106ef21262c050af43fe6d16d9a3021418be24513c2fe0d7b00/68747470733a2f2f7261772e6769746875622e636f6d2f5048504d61696c65722f5048504d61696c65722f6d61737465722f6578616d706c65732f696d616765732f7068706d61696c65722e706e67)](https://camo.githubusercontent.com/9cb2da7fa70cc106ef21262c050af43fe6d16d9a3021418be24513c2fe0d7b00/68747470733a2f2f7261772e6769746875622e636f6d2f5048504d61696c65722f5048504d61696c65722f6d61737465722f6578616d706c65732f696d616765732f7068706d61696c65722e706e67)

PHPMailer – A full-featured email creation and transfer class for PHP
=====================================================================

[](#phpmailer--a-full-featured-email-creation-and-transfer-class-for-php)

[![Test status](https://github.com/PHPMailer/PHPMailer/workflows/Tests/badge.svg)](https://github.com/PHPMailer/PHPMailer/actions)[![codecov.io](https://camo.githubusercontent.com/4eb61d0d6b8160924afe8192e91de7938dd12bb74ed2e32684ac1a34b619a16c/68747470733a2f2f636f6465636f762e696f2f67682f5048504d61696c65722f5048504d61696c65722f6272616e63682f6d61737465722f67726170682f62616467652e7376673f746f6b656e3d694f525a70776d596d4d)](https://codecov.io/gh/PHPMailer/PHPMailer)[![Latest Stable Version](https://camo.githubusercontent.com/42469c87a88a5686f9b57421aa60313cab921fb98bc7210844a740c0dc357542/68747470733a2f2f706f7365722e707567782e6f72672f7068706d61696c65722f7068706d61696c65722f762f737461626c652e737667)](https://packagist.org/packages/phpmailer/phpmailer)[![Total Downloads](https://camo.githubusercontent.com/aed476d48bf942e9a6ec22ddb0fe4e4423ce0fd2480bb0915b58cd49d2550926/68747470733a2f2f706f7365722e707567782e6f72672f7068706d61696c65722f7068706d61696c65722f646f776e6c6f616473)](https://packagist.org/packages/phpmailer/phpmailer)[![License](https://camo.githubusercontent.com/52dd7d20e149fe9a53c83bc103afd57f494f38a2ae5c2f7dc8a634e1c3d2544a/68747470733a2f2f706f7365722e707567782e6f72672f7068706d61696c65722f7068706d61696c65722f6c6963656e73652e737667)](https://packagist.org/packages/phpmailer/phpmailer)[![API Docs](https://github.com/phpmailer/phpmailer/workflows/Docs/badge.svg)](https://phpmailer.github.io/PHPMailer/)[![OpenSSF Scorecard](https://camo.githubusercontent.com/ef545716054c503bb7d177047c055cdf6b838f46638dcebdce4ddb6147b79d42/68747470733a2f2f6170692e736563757269747973636f726563617264732e6465762f70726f6a656374732f6769746875622e636f6d2f5048504d61696c65722f5048504d61696c65722f6261646765)](https://api.securityscorecards.dev/projects/github.com/PHPMailer/PHPMailer)

Features
--------

[](#features)

- Probably the world's most popular code for sending email from PHP!
- Used by many open-source projects: WordPress, Drupal, 1CRM, SugarCRM, Yii, Joomla! and many more
- Integrated SMTP support – send without a local mail server
- Send emails with multiple To, CC, BCC, and Reply-to addresses
- Multipart/alternative emails for mail clients that do not read HTML email
- Add attachments, including inline
- Support for UTF-8 content and 8bit, base64, binary, and quoted-printable encodings
- Full UTF-8 support when using servers that support `SMTPUTF8`.
- Support for iCal events in multiparts and attachments
- SMTP authentication with `LOGIN`, `PLAIN`, `CRAM-MD5`, and `XOAUTH2` mechanisms over SMTPS and SMTP+STARTTLS transports
- Validates email addresses automatically
- Protects against header injection attacks
- Error messages in over 50 languages!
- DKIM and S/MIME signing support
- Compatible with PHP 5.5 and later, including PHP 8.4
- Namespaced to prevent name clashes
- Much more!

Why you might need it
---------------------

[](#why-you-might-need-it)

Many PHP developers need to send email from their code. The only PHP function that supports this directly is [`mail()`](https://www.php.net/manual/en/function.mail.php). However, it does not provide any assistance for making use of popular features such as authentication, HTML messages, and attachments.

Formatting email correctly is surprisingly difficult. There are myriad overlapping (and conflicting) standards, requiring tight adherence to horribly complicated formatting and encoding rules – the vast majority of code that you'll find online that uses the `mail()` function directly is just plain wrong, if not unsafe!

The PHP `mail()` function usually sends via a local mail server, typically fronted by a `sendmail` binary on Linux, BSD, and macOS platforms, however, Windows usually doesn't include a local mail server; PHPMailer's integrated SMTP client allows email sending on all platforms without needing a local mail server. Be aware though, that the `mail()` function should be avoided when possible; it's both faster and [safer](https://exploitbox.io/paper/Pwning-PHP-Mail-Function-For-Fun-And-RCE.html) to use SMTP to localhost.

*Please* don't be tempted to do it yourself – if you don't use PHPMailer, there are many other excellent libraries that you should look at before rolling your own. Try [Symfony Mailer](https://symfony.com/doc/current/mailer.html), [Laminas/Mail](https://docs.laminas.dev/laminas-mail/), [ZetaComponents](https://github.com/zetacomponents/Mail), etc.

License
-------

[](#license)

This software is distributed under the [LGPL 2.1](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html) license, along with the [GPL Cooperation Commitment](https://gplcc.github.io/gplcc/). Please read [LICENSE](https://github.com/PHPMailer/PHPMailer/blob/master/LICENSE) for information on the software availability and distribution.

Installation &amp; loading
--------------------------

[](#installation--loading)

PHPMailer is available on [Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), and installation via [Composer](https://getcomposer.org) is the recommended way to install PHPMailer. Just add this line to your `composer.json` file:

```
"phpmailer/phpmailer": "^6.10.0"
```

or run

```
composer require phpmailer/phpmailer
```

Note that the `vendor` folder and the `vendor/autoload.php` script are generated by Composer; they are not part of PHPMailer.

If you want to use XOAUTH2 authentication, you will also need to add a dependency on the `league/oauth2-client` and appropriate service adapters package in your `composer.json`, or take a look at by @decomplexity's [SendOauth2 wrapper](https://github.com/decomplexity/SendOauth2), especially if you're using Microsoft services.

Alternatively, if you're not using Composer, you can [download PHPMailer as a zip file](https://github.com/PHPMailer/PHPMailer/archive/master.zip), (note that docs and examples are not included in the zip file), then copy the contents of the PHPMailer folder into one of the `include_path` directories specified in your PHP configuration and load each class file manually:

```
