{"id":15356683,"url":"https://github.com/filips123/monologphpmailer","last_synced_at":"2025-06-16T03:06:33.185Z","repository":{"id":62504649,"uuid":"147514250","full_name":"filips123/MonologPHPMailer","owner":"filips123","description":"PHPMailer handler for Monolog","archived":false,"fork":false,"pushed_at":"2023-10-16T22:51:25.000Z","size":25,"stargazers_count":13,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-07T04:44:34.407Z","etag":null,"topics":["email","log","logging","monolog","monolog-handler","php","phpmailer","psr-3"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/filips123.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"tidelift":"packagist/filips123/monolog-phpmailer","github":"filips123","patreon":"filips","ko_fi":"filips","liberapay":"filips","custom":["https://donorbox.org/filips","https://buymeacoff.ee/filips"]}},"created_at":"2018-09-05T12:28:53.000Z","updated_at":"2025-01-14T17:54:11.000Z","dependencies_parsed_at":"2024-06-21T15:37:20.731Z","dependency_job_id":"44dae26a-ca47-4aae-a15d-e7d9193bc545","html_url":"https://github.com/filips123/MonologPHPMailer","commit_stats":{"total_commits":27,"total_committers":1,"mean_commits":27.0,"dds":0.0,"last_synced_commit":"7c5745f988f9cf4b5e8ed4a017d0eb40cdf7ff08"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filips123%2FMonologPHPMailer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filips123%2FMonologPHPMailer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filips123%2FMonologPHPMailer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filips123%2FMonologPHPMailer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/filips123","download_url":"https://codeload.github.com/filips123/MonologPHPMailer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240280985,"owners_count":19776418,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["email","log","logging","monolog","monolog-handler","php","phpmailer","psr-3"],"created_at":"2024-10-01T12:29:36.293Z","updated_at":"2025-02-27T03:30:50.940Z","avatar_url":"https://github.com/filips123.png","language":"PHP","funding_links":["https://tidelift.com/funding/github/packagist/filips123/monolog-phpmailer","https://github.com/sponsors/filips123","https://patreon.com/filips","https://ko-fi.com/filips","https://liberapay.com/filips","https://donorbox.org/filips","https://buymeacoff.ee/filips"],"categories":[],"sub_categories":[],"readme":"MonologPHPMailer\n================\n\n[![version][icon-version]][link-packagist]\n[![downloads][icon-downloads]][link-packagist]\n[![license][icon-license]][link-license]\n[![php][icon-php]][link-php]\n[![build][icon-build]][link-build]\n[![coverage][icon-coverage]][link-coverage]\n[![quality][icon-quality]][link-quality]\n\nMonologPHPMailer is a [PHPMailer][link-phpmailer] handler for [Monolog][link-monolog]. It enables you to send logs to emails with PHPMailer.\n\n## Installation\n\n### Requirements\n\nMonologPHPMailer requires [PHP][link-php] 8.1 or higher, [Monolog][link-monolog] 3.x, and [PHPMailer][link-phpmailer] 6.x.\n\n### Using Composer\n\nThe recommended way to install MonologPHPMailer is with [Composer][link-composer], a dependency manager for PHP.\n\nYou should just add `filips123/monolog-phpmailer` to your project dependencies in `composer.json`. It will also install Monolog and PHPMailer, but it is recommended to add them manually to `composer.json`.\n\n```json\n{\n    \"require\": {\n        \"monolog/monolog\": \"^3.0\",\n        \"phpmailer/phpmailer\": \"^6.0\",\n        \"filips123/monolog-phpmailer\": \"^2.0\"\n    }\n}\n```\n\nDo not forget to run `composer install` and add `require 'vendor/autoload.php';` to your main script.\n\n### Manually Installation\n\nAlternatively, you could download all files in the [`src`][link-handlers] directory from GitHub and then manually include them in your script. You also have to install Monolog and PHPMailer manually.\n\n## Usage\n\nYou should just add the handler `MonologPHPMailer\\PHPMailerHandler` to your logger. Its first argument must be a PHPMailer instance.\n\n## Example\n\n```php\n\u003c?php\n\nuse MonologPHPMailer\\PHPMailerHandler;\n\nuse Monolog\\Formatter\\HtmlFormatter;\nuse Monolog\\Logger;\nuse Monolog\\Processor\\IntrospectionProcessor;\nuse Monolog\\Processor\\MemoryUsageProcessor;\nuse Monolog\\Processor\\WebProcessor;\n\nuse PHPMailer\\PHPMailer\\PHPMailer;\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$mailer = new PHPMailer(true);\n$logger = new Logger('logger');\n\n$mailer-\u003eisSMTP();\n$mailer-\u003eHost = 'smtp.example.com';\n$mailer-\u003eSMTPAuth = true;\n$mailer-\u003eUsername = 'server@example.com';\n$mailer-\u003ePassword = 'password';\n\n$mailer-\u003esetFrom('server@example.com', 'Logging Server');\n$mailer-\u003eaddAddress('user@example.com', 'Your Name');\n\n$logger-\u003epushProcessor(new IntrospectionProcessor);\n$logger-\u003epushProcessor(new MemoryUsageProcessor);\n$logger-\u003epushProcessor(new WebProcessor);\n\n$handler = new PHPMailerHandler($mailer);\n$handler-\u003esetFormatter(new HtmlFormatter);\n\n$logger-\u003epushHandler($handler);\n\n$logger-\u003eerror('Error!');\n$logger-\u003ealert('Something went wrong!');\n\n```\n\n## Versioning\n\nThis library uses [SemVer][link-semver] SemVer for versioning. For the versions available, see the [tags on this repository][link-tags].\n\n## License\n\nThis library is licensed under the MIT license. See the [LICENSE][link-license-file] file for details.\n\n[icon-version]: https://img.shields.io/packagist/v/filips123/monolog-phpmailer.svg?style=flat-square\u0026label=version\n[icon-downloads]: https://img.shields.io/packagist/dt/filips123/monolog-phpmailer.svg?style=flat-square\u0026label=downloads\n[icon-license]: https://img.shields.io/packagist/l/filips123/monolog-phpmailer.svg?style=flat-square\u0026label=license\n[icon-php]: https://img.shields.io/packagist/php-v/filips123/monolog-phpmailer.svg?style=flat-square\u0026label=php\n[icon-build]: https://img.shields.io/github/actions/workflow/status/filips123/MonologPHPMailer/main.yml?style=flat-square\u0026label=build\n[icon-coverage]: https://img.shields.io/scrutinizer/coverage/g/filips123/MonologPHPMailer.svg?style=flat-square\u0026label=coverage\n[icon-quality]: https://img.shields.io/scrutinizer/g/filips123/MonologPHPMailer.svg?style=flat-square\u0026label=quality\n\n[link-packagist]: https://packagist.org/packages/filips123/monolog-phpmailer/\n[link-license]: https://choosealicense.com/licenses/mit/\n[link-php]: https://php.net/\n[link-build]: https://github.com/filips123/MonologPHPMailer/actions\n[link-coverage]: https://scrutinizer-ci.com/g/filips123/MonologPHPMailer/code-structure/\n[link-quality]: https://scrutinizer-ci.com/g/filips123/MonologPHPMailer/\n\n[link-monolog]: https://github.com/Seldaek/monolog/\n[link-phpmailer]: https://github.com/PHPMailer/PHPMailer/\n[link-composer]: https://getcomposer.org/\n[link-handlers]: https://github.com/filips123/MonologPHPMailer/tree/master/src\n[link-semver]: https://semver.org/\n[link-tags]: https://github.com/filips123/MonologPHPMailer/tags/\n[link-license-file]: https://github.com/filips123/MonologPHPMailer/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilips123%2Fmonologphpmailer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffilips123%2Fmonologphpmailer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilips123%2Fmonologphpmailer/lists"}