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

ActiveLibrary

wsw/phpmailer
=============

PHPMailer modificado para receber duas chaves DKIM

5.2.15(10y ago)674LGPL-2.1PHPPHP &gt;=5.0.0

Since Feb 21Pushed 10y ago1 watchersCompare

[ Source](https://github.com/whera/PHPMailer)[ Packagist](https://packagist.org/packages/wsw/phpmailer)[ RSS](/packages/wsw-phpmailer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

[![PHPMailer](https://camo.githubusercontent.com/203b9e961bc149f273b87af29e4c2a9230c0901ab8d4bb3354266fa47fbdb36b/68747470733a2f2f7261772e6769746875622e636f6d2f77686572612f5048504d61696c65722f6d61737465722f6578616d706c65732f696d616765732f7068706d61696c65722e706e67)](https://camo.githubusercontent.com/203b9e961bc149f273b87af29e4c2a9230c0901ab8d4bb3354266fa47fbdb36b/68747470733a2f2f7261772e6769746875622e636f6d2f77686572612f5048504d61696c65722f6d61737465722f6578616d706c65732f696d616765732f7068706d61696c65722e706e67)

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

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

Build status: [![Build Status](https://camo.githubusercontent.com/f4a0071af38710ae87f12af9fb4571f43042318a5978c9d40b13dc4db8c4e567/68747470733a2f2f7472617669732d63692e6f72672f5048504d61696c65722f5048504d61696c65722e737667)](https://travis-ci.org/PHPMailer/PHPMailer)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/689aaed6796eb861f94a0220afe455603f25f76bb50927ff48c7724821806fa7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f5048504d61696c65722f5048504d61696c65722f6261646765732f7175616c6974792d73636f72652e706e673f733d33373538653231643237396265636466383437613535376135366133656431366466656339643564)](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/)[![Code Coverage](https://camo.githubusercontent.com/84c9b6c9bc4c027519a2f5af556ac30740e2921c6ca4aa8123f295f16c8fce41/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f5048504d61696c65722f5048504d61696c65722f6261646765732f636f7665726167652e706e673f733d33666536636135666538636432636466393632383537353665343239333266376361323536393632)](https://scrutinizer-ci.com/g/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) [![Latest Unstable Version](https://camo.githubusercontent.com/8aaa6977ab7891d5c6fa73c89a3b1a415b5713daffe622f9b5ace6e1ac2e4299/68747470733a2f2f706f7365722e707567782e6f72672f7068706d61696c65722f7068706d61696c65722f762f756e737461626c652e737667)](https://packagist.org/packages/phpmailer/phpmailer) [![License](https://camo.githubusercontent.com/52dd7d20e149fe9a53c83bc103afd57f494f38a2ae5c2f7dc8a634e1c3d2544a/68747470733a2f2f706f7365722e707567782e6f72672f7068706d61696c65722f7068706d61696c65722f6c6963656e73652e737667)](https://packagist.org/packages/phpmailer/phpmailer)

Class Features
--------------

[](#class-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 TOs, CCs, BCCs and REPLY-TOs
- Multipart/alternative emails for mail clients that do not read HTML email
- Support for UTF-8 content and 8bit, base64, binary, and quoted-printable encodings
- SMTP authentication with LOGIN, PLAIN, NTLM, CRAM-MD5 and Google's XOAUTH2 mechanisms over SSL and TLS transports
- Error messages in 47 languages!
- DKIM and S/MIME signing support
- Compatible with PHP 5.0 and later
- Much more!

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

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

Many PHP developers utilize email in their code. The only PHP function that supports this is the `mail()` function. However, it does not provide any assistance for making use of popular features such as HTML-based emails and attachments.

Formatting email correctly is surprisingly difficult. There are myriad overlapping RFCs, 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! *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 SwiftMailer, Zend\_Mail, eZcomponents etc.

The PHP `mail()` function usually sends via a local mail server, typically fronted by a `sendmail` binary on Linux, BSD and OS X platforms, however, Windows usually doesn't include a local mail server; PHPMailer's integrated SMTP implementation allows email sending on Windows platforms without a local mail server.

License
-------

[](#license)

This software is distributed under the [LGPL 2.1](http://www.gnu.org/licenses/lgpl-2.1.html) license. Please read LICENSE for information on the software availability and distribution.

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

[](#installation--loading)

PHPMailer is available via [Composer/Packagist](https://packagist.org/packages/wsw/phpmailer) (using semantic versioning), so just add this line to your `composer.json` file:

```
"wsw/phpmailer": "~5.2"
```

or

```
composer require wsw/phpmailer
```

If you want to use the Gmail XOAUTH2 authentication class, you will also need to add a dependency on the `league/oauth2-client` package.

Alternatively, copy the contents of the PHPMailer folder into one of the `include_path` directories specified in your PHP configuration. If you don't speak git or just want a tarball, click the 'zip' button at the top of the page in GitHub.

If you're not using composer's autoloader, PHPMailer provides an SPL-compatible autoloader, and that is the preferred way of loading the library - just `require '/path/to/PHPMailerAutoload.php';` and everything should work. The autoloader does not throw errors if it can't find classes so it prepends itself to the SPL list, allowing your own (or your framework's) autoloader to catch errors. SPL autoloading was introduced in PHP 5.1.0, so if you are using a version older than that you will need to require/include each class manually.

PHPMailer does *not* declare a namespace because namespaces were only introduced in PHP 5.3.

If you want to use Google's XOAUTH2 authentication mechanism, you need to be running at least PHP 5.4, and load the dependencies listed in `composer.json`.

### Minimal installation

[](#minimal-installation)

While installing the entire package manually or with composer is simple, convenient and reliable, you may want to include only vital files in your project. At the very least you will need [class.phpmailer.php](https://github.com/PHPMailer/PHPMailer/class.phpmailer.php). If you're using SMTP, you'll need [class.smtp.php](https://github.com/PHPMailer/PHPMailer/class.smtp.php), and if you're using POP-before SMTP, you'll need [class.pop3.php](class.pop3.php). For all of these, we recommend you use [the autoloader](https://github.com/PHPMailer/PHPMailer/PHPMailerAutoload.php) too as otherwise you will either have to `require` all classes manually or use some other autoloader. You can skip the [language](https://github.com/PHPMailer/PHPMailer/language/) folder if you're not showing errors to users and can make do with English-only errors. You may need the additional classes in the [extras](extras/) folder if you are using those features, including NTLM authentication and ics generation. If you're using Google XOAUTH2 you will need `class.phpmaileroauth.php` and `class.oauth.php` classes too, as well as the composer dependencies.

A Simple Example
----------------

[](#a-simple-example)

```
