{
	"id": "20bc63c0-a762-4e39-ad7f-fd6b40fe626a",
	"created_at": "2026-04-06T03:36:48.688408Z",
	"updated_at": "2026-04-10T03:21:50.632799Z",
	"deleted_at": null,
	"sha1_hash": "acf5f3b75ff88d3b2fff4ed25e276c2b81af86a0",
	"title": "GitHub - PHPMailer/PHPMailer: The classic email sending library for PHP",
	"llm_title": "",
	"authors": "",
	"file_creation_date": "0001-01-01T00:00:00Z",
	"file_modification_date": "0001-01-01T00:00:00Z",
	"file_size": 163892,
	"plain_text": "GitHub - PHPMailer/PHPMailer: The classic email sending\r\nlibrary for PHP\r\nBy Synchro\r\nArchived: 2026-04-06 03:31:29 UTC\r\nRussia invaded Ukraine, killing tens of thousands of civilians and displacing millions more.\r\nIt's a genocide. Please help us defend freedom, democracy and Ukraine's right to exist.\r\nHelp Ukraine Now ➔\r\nPHPMailer – A full-featured email creation and transfer class for PHP\r\nTests passing\r\n \r\ncodecov 75% ssttaabbllee vv77..00..22\r\n ddoowwnnllooaaddss 99M lliicceennssee LLGGPPLL--22..11 Docs passing\r\nooppeennssssff ssccoorreeccaarrdd 7.5\r\nFeatures\r\nProbably the world's most popular code for sending email from PHP!\r\nUsed by many open-source projects: WordPress, Drupal, 1CRM, SugarCRM, Yii, Joomla! and many more\r\nIntegrated SMTP support – send without a local mail server\r\nSend emails with multiple To, CC, BCC, and Reply-to addresses\r\nMultipart/alternative emails for mail clients that do not read HTML email\r\nAdd attachments, including inline\r\nSupport for UTF-8 content and 8bit, base64, binary, and quoted-printable encodings\r\nFull UTF-8 support when using servers that support SMTPUTF8 .\r\nSupport for iCal events in multiparts and attachments\r\nSMTP authentication with LOGIN , PLAIN , CRAM-MD5 , and XOAUTH2 mechanisms over SMTPS and\r\nSMTP+STARTTLS transports\r\nValidates email addresses automatically\r\nProtects against header injection attacks\r\nError messages in over 50 languages!\r\nDKIM and S/MIME signing support\r\nCompatible with PHP 5.5 and later, including PHP 8.5\r\nhttps://github.com/PHPMailer/PHPMailer\r\nPage 1 of 7\n\nNamespaced to prevent name clashes\r\nMuch more!\r\nWhy you might need it\r\nMany PHP developers need to send email from their code. The only PHP function that supports this directly is\r\nmail() . However, it does not provide any assistance for making use of popular features such as authentication,\r\nHTML messages, and attachments.\r\nFormatting email correctly is surprisingly difficult. There are myriad overlapping (and conflicting) standards,\r\nrequiring tight adherence to horribly complicated formatting and encoding rules – the vast majority of code that\r\nyou'll find online that uses the mail() function directly is just plain wrong, if not unsafe!\r\nThe PHP mail() function usually sends via a local mail server, typically fronted by a sendmail binary on\r\nLinux, BSD, and macOS platforms, however, Windows usually doesn't include a local mail server; PHPMailer's\r\nintegrated SMTP client allows email sending on all platforms without needing a local mail server. Be aware\r\nthough, that the mail() function should be avoided when possible; it's both faster and safer to use SMTP to\r\nlocalhost.\r\nPlease don't be tempted to do it yourself – if you don't use PHPMailer, there are many other excellent libraries that\r\nyou should look at before rolling your own. Try Symfony Mailer, Laminas/Mail, ZetaComponents, etc.\r\nLicense\r\nThis software is distributed under the LGPL 2.1 license, along with the GPL Cooperation Commitment. Please\r\nread LICENSE for information on the software availability and distribution.\r\nInstallation \u0026 loading\r\nPHPMailer is available on Packagist (using semantic versioning), and installation via Composer is the\r\nrecommended way to install PHPMailer. Just add this line to your composer.json file:\r\n\"phpmailer/phpmailer\": \"^7.0.0\"\r\nor run\r\ncomposer require phpmailer/phpmailer\r\nNote that the vendor folder and the vendor/autoload.php script are generated by Composer; they are not part\r\nof PHPMailer.\r\nIf you want to use XOAUTH2 authentication, you will also need to add a dependency on the league/oauth2-\r\nclient and appropriate service adapters package in your composer.json , or take a look at by @decomplexity's\r\nSendOauth2 wrapper, especially if you're using Microsoft services.\r\nhttps://github.com/PHPMailer/PHPMailer\r\nPage 2 of 7\n\nAlternatively, if you're not using Composer, you can download PHPMailer as a zip file, (note that docs and\r\nexamples are not included in the zip file), then copy the contents of the PHPMailer folder into one of the\r\ninclude_path directories specified in your PHP configuration and load each class file manually:\r\n\u003c?php\r\nuse PHPMailer\\PHPMailer\\PHPMailer;\r\nuse PHPMailer\\PHPMailer\\Exception;\r\nrequire 'path/to/PHPMailer/src/Exception.php';\r\nrequire 'path/to/PHPMailer/src/PHPMailer.php';\r\nrequire 'path/to/PHPMailer/src/SMTP.php';\r\nIf you're not using the SMTP class explicitly (you're probably not), you don't need a use line for it. Even if\r\nyou're not using exceptions, you do still need to load the Exception class as it is used internally.\r\nLegacy versions\r\nPHPMailer 5.2 (which is compatible with PHP 5.0 — 7.0) is no longer supported, even for security updates. You\r\nwill find the latest version of 5.2 in the 5.2-stable branch. If you're using PHP 5.5 or later (which you should be),\r\nswitch to the 6.x releases.\r\nUpgrading from 5.2\r\nThe biggest changes are that source files are now in the src/ folder, and PHPMailer now declares the\r\nnamespace PHPMailer\\PHPMailer . This has several important effects – read the upgrade guide for more details.\r\nMinimal installation\r\nWhile installing the entire package manually or with Composer is simple, convenient, and reliable, you may want\r\nto include only vital files in your project. At the very least you will need src/PHPMailer.php. If you're using\r\nSMTP, you'll need src/SMTP.php, and if you're using POP-before SMTP (very unlikely!), you'll need\r\nsrc/POP3.php. You can skip the language folder if you're not showing errors to users and can make do with\r\nEnglish-only errors. If you're using XOAUTH2 you will need src/OAuth.php as well as the Composer\r\ndependencies for the services you wish to authenticate with. Really, it's much easier to use Composer!\r\nA Simple Example\r\n\u003c?php\r\n//Import PHPMailer classes into the global namespace\r\n//These must be at the top of your script, not inside a function\r\nuse PHPMailer\\PHPMailer\\PHPMailer;\r\nuse PHPMailer\\PHPMailer\\SMTP;\r\nuse PHPMailer\\PHPMailer\\Exception;\r\n//Load Composer's autoloader (created by composer, not included with PHPMailer)\r\nhttps://github.com/PHPMailer/PHPMailer\r\nPage 3 of 7\n\nrequire 'vendor/autoload.php';\r\n//Create an instance; passing `true` enables exceptions\r\n$mail = new PHPMailer(true);\r\ntry {\r\n //Server settings\r\n $mail-\u003eSMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output\r\n $mail-\u003eisSMTP(); //Send using SMTP\r\n $mail-\u003eHost = 'smtp.example.com'; //Set the SMTP server to send through\r\n $mail-\u003eSMTPAuth = true; //Enable SMTP authentication\r\n $mail-\u003eUsername = 'user@example.com'; //SMTP username\r\n $mail-\u003ePassword = 'secret'; //SMTP password\r\n $mail-\u003eSMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable implicit TLS encryption\r\n $mail-\u003ePort = 465; //TCP port to connect to; use 587 if\r\n //Recipients\r\n $mail-\u003esetFrom('from@example.com', 'Mailer');\r\n $mail-\u003eaddAddress('joe@example.net', 'Joe User'); //Add a recipient\r\n $mail-\u003eaddAddress('ellen@example.com'); //Name is optional\r\n $mail-\u003eaddReplyTo('info@example.com', 'Information');\r\n $mail-\u003eaddCC('cc@example.com');\r\n $mail-\u003eaddBCC('bcc@example.com');\r\n //Attachments\r\n $mail-\u003eaddAttachment('/var/tmp/file.tar.gz'); //Add attachments\r\n $mail-\u003eaddAttachment('/tmp/image.jpg', 'new.jpg'); //Optional name\r\n //Content\r\n $mail-\u003eisHTML(true); //Set email format to HTML\r\n $mail-\u003eSubject = 'Here is the subject';\r\n $mail-\u003eBody = 'This is the HTML message body \u003cb\u003ein bold!\u003c/b\u003e';\r\n $mail-\u003eAltBody = 'This is the body in plain text for non-HTML mail clients';\r\n $mail-\u003esend();\r\n echo 'Message has been sent';\r\n} catch (Exception $e) {\r\n echo \"Message could not be sent. Mailer Error: {$mail-\u003eErrorInfo}\";\r\n}\r\nYou'll find plenty to play with in the examples folder, which covers many common scenarios including sending\r\nthrough Gmail, building contact forms, sending to mailing lists, and more.\r\nIf you are re-using the instance (e.g. when sending to a mailing list), you may need to clear the recipient list to\r\navoid sending duplicate messages. See the mailing list example for further guidance.\r\nThat's it. You should now be ready to use PHPMailer!\r\nhttps://github.com/PHPMailer/PHPMailer\r\nPage 4 of 7\n\nLocalization\r\nPHPMailer defaults to English, but in the language folder, you'll find many translations for PHPMailer error\r\nmessages that you may encounter. Their filenames contain ISO 639-1 language code for the translations, for\r\nexample fr for French. To specify a language, you need to tell PHPMailer which one to use, like this:\r\n//To load the French version\r\n$mail-\u003esetLanguage('fr', '/optional/path/to/language/directory/');\r\nWe welcome corrections and new languages – if you're looking for corrections, run the\r\nLanguage/TranslationCompletenessTest.php script in the tests folder and it will show any missing translations.\r\nDocumentation\r\nStart reading at the GitHub wiki. If you're having trouble, head for the troubleshooting guide as it's frequently\r\nupdated.\r\nExamples of how to use PHPMailer for common scenarios can be found in the examples folder. If you're looking\r\nfor a good starting point, we recommend you start with the Gmail example.\r\nTo reduce PHPMailer's deployed code footprint, examples are not included if you load PHPMailer via Composer\r\nor via GitHub's zip file download, so you'll need to either clone the git repository or use the above links to get to\r\nthe examples directly.\r\nComplete generated API documentation is available online.\r\nYou can generate complete API-level documentation by running phpdoc in the top-level folder, and\r\ndocumentation will appear in the docs folder, though you'll need to have PHPDocumentor installed. You may\r\nfind the unit tests a good reference for how to do various operations such as encryption.\r\nIf the documentation doesn't cover what you need, search the many questions on Stack Overflow, and before you\r\nask a question about \"SMTP Error: Could not connect to SMTP host.\", read the troubleshooting guide.\r\nTests\r\nPHPMailer tests use PHPUnit 9, with a polyfill to let 9-style tests run on older PHPUnit and PHP versions.\r\nTests passing\r\nIf this isn't passing, is there something you can do to help?\r\nSecurity\r\nPlease disclose any vulnerabilities found responsibly – report security issues to the maintainers privately.\r\nSee SECURITY and PHPMailer's security advisories on GitHub.\r\nhttps://github.com/PHPMailer/PHPMailer\r\nPage 5 of 7\n\nContributing\r\nPlease submit bug reports, suggestions, and pull requests to the GitHub issue tracker.\r\nWe're particularly interested in fixing edge cases, expanding test coverage, and updating translations.\r\nIf you found a mistake in the docs, or want to add something, go ahead and amend the wiki – anyone can edit it.\r\nIf you have git clones from prior to the move to the PHPMailer GitHub organisation, you'll need to update any\r\nremote URLs referencing the old GitHub location with a command like this from within your clone:\r\ngit remote set-url upstream https://github.com/PHPMailer/PHPMailer.git\r\nPlease don't use the SourceForge or Google Code projects any more; they are obsolete and no longer maintained.\r\nSponsorship\r\nDevelopment time and resources for PHPMailer are provided by Smartmessages.net, the world's only privacy-first\r\nemail marketing system.\r\nDonations are very welcome, whether in beer 🍺, T-shirts 👕, or cold, hard cash 💰. Sponsorship through GitHub\r\nis a simple and convenient way to say \"thank you\" to PHPMailer's maintainers and contributors – just click the\r\n\"Sponsor\" button on the project page. If your company uses PHPMailer, consider taking part in Tidelift's\r\nenterprise support programme.\r\nPHPMailer For Enterprise\r\nAvailable as part of the Tidelift Subscription.\r\nThe maintainers of PHPMailer and thousands of other packages are working with Tidelift to deliver commercial\r\nsupport and maintenance for the open-source packages you use to build your applications. Save time, reduce risk,\r\nand improve code health, while paying the maintainers of the exact packages you use. Learn more.\r\nChangelog\r\nSee changelog.\r\nHistory\r\nPHPMailer was originally written in 2001 by Brent R. Matzelle as a SourceForge project.\r\nMarcus Bointon ( coolbru on SF) and Andy Prevost ( codeworxtech ) took over the project in 2004.\r\nBecame an Apache incubator project on Google Code in 2010, managed by Jim Jagielski.\r\nhttps://github.com/PHPMailer/PHPMailer\r\nPage 6 of 7\n\nMarcus created his fork on GitHub in 2008.\r\nJim and Marcus decide to join forces and use GitHub as the canonical and official repo for PHPMailer in\r\n2013.\r\nPHPMailer moves to the PHPMailer organisation on GitHub in 2013.\r\nWhat's changed since moving from SourceForge?\r\nOfficial successor to the SourceForge and Google Code projects.\r\nTest suite.\r\nContinuous integration with GitHub Actions.\r\nComposer support.\r\nPublic development.\r\nAdditional languages and language strings.\r\nCRAM-MD5 authentication support.\r\nPreserves full repo history of authors, commits, and branches from the original SourceForge project.\r\nSource: https://github.com/PHPMailer/PHPMailer\r\nhttps://github.com/PHPMailer/PHPMailer\r\nPage 7 of 7",
	"extraction_quality": 1,
	"language": "EN",
	"sources": [
		"ETDA"
	],
	"references": [
		"https://github.com/PHPMailer/PHPMailer"
	],
	"report_names": [
		"PHPMailer"
	],
	"threat_actors": [],
	"ts_created_at": 1775446608,
	"ts_updated_at": 1775791310,
	"ts_creation_date": 0,
	"ts_modification_date": 0,
	"files": {
		"pdf": "https://archive.orkl.eu/acf5f3b75ff88d3b2fff4ed25e276c2b81af86a0.pdf",
		"text": "https://archive.orkl.eu/acf5f3b75ff88d3b2fff4ed25e276c2b81af86a0.txt",
		"img": "https://archive.orkl.eu/acf5f3b75ff88d3b2fff4ed25e276c2b81af86a0.jpg"
	}
}