{"id":19511281,"url":"https://github.com/jornatf/msgraph-mailer","last_synced_at":"2026-05-16T02:07:33.182Z","repository":{"id":151590037,"uuid":"624419511","full_name":"jornatf/msgraph-mailer","owner":"jornatf","description":"A Laravel Package to send emails with Microsoft Graph API.","archived":false,"fork":false,"pushed_at":"2023-10-09T01:04:47.000Z","size":49,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-08T12:11:17.514Z","etag":null,"topics":["api","laravel","laravel-package","microsoft-graph","microsoft-graph-api","php","send-mail"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/jornatf/msgraph-mailer","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/jornatf.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2023-04-06T12:32:05.000Z","updated_at":"2023-05-04T16:49:43.000Z","dependencies_parsed_at":"2025-01-10T05:50:33.142Z","dependency_job_id":null,"html_url":"https://github.com/jornatf/msgraph-mailer","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jornatf%2Fmsgraph-mailer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jornatf%2Fmsgraph-mailer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jornatf%2Fmsgraph-mailer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jornatf%2Fmsgraph-mailer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jornatf","download_url":"https://codeload.github.com/jornatf/msgraph-mailer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240761142,"owners_count":19853256,"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":["api","laravel","laravel-package","microsoft-graph","microsoft-graph-api","php","send-mail"],"created_at":"2024-11-10T23:20:11.680Z","updated_at":"2026-05-16T02:07:28.152Z","avatar_url":"https://github.com/jornatf.png","language":"PHP","funding_links":["https://www.buymeacoffee.com/jornatf"],"categories":[],"sub_categories":[],"readme":"# Msgraph Mailer\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/jornatf/msgraph-mailer.svg?style=flat-square)](https://packagist.org/packages/jornatf/msgraph-mailer)\n[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/jornatf/msgraph-mailer/run-tests.yml?branch=main\u0026label=tests\u0026style=flat-square)](https://github.com/jornatf/msgraph-mailer/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/jornatf/msgraph-mailer/fix-php-code-style-issues.yml?branch=main\u0026label=code%20style\u0026style=flat-square)](https://github.com/jornatf/msgraph-mailer/actions?query=workflow%3A\"Fix+PHP+code+style+issues\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/jornatf/msgraph-mailer.svg?style=flat-square)](https://packagist.org/packages/jornatf/msgraph-mailer)\n\nA Laravel Package to send emails with [Microsoft Graph API](https://learn.microsoft.com/en-us/graph/use-the-api).\n\n\u003e #### If you like this package you can [Buy me a Coffee](https://www.buymeacoffee.com/jornatf) ☕️\n\n## Installation\n\n### Via composer:\n\n```bash\ncomposer require jornatf/msgraph-mailer\n```\n\n### Prerequisites:\n\nAdd your [Microsoft Graph](https://learn.microsoft.com/en-us/graph/overview) credentials in the `.env` file:\n\n```\nMSGRAPH_CLIENT_ID=your_client_id\nMSGRAPH_SECRET_ID=your_secret_id\nMSGRAPH_TENANT_ID=your_tenant_id\n```\n\n## Usage\n\n### Example:\n\n\u003e This example shows you how to use the basic methods required to send an email.\n\n```php\n\u003c?php\n\nnamespace App\\Http\\Controllers;\n\nuse App\\Http\\Controllers\\Controller;\n\nclass PostController extends Controller\n{\n    public function sendMail()\n    {\n        try {\n            $msgraph = MsGraphMailer::mail('your@mailbox.com')\n                -\u003eto(['John Doe:john.doe@example.com', 'other@example.com', $otherRecipients])\n                -\u003esubject('A simple email')\n                -\u003ebody('\u003ch1\u003eSend a simple email to one recipient.\u003c/h1\u003e')\n                -\u003esend();\n        } catch (\\Exception $e) {\n            return $e-\u003egetMessage();\n        }\n\n        return \"Email sended!\";\n    }\n}\n```\n\n### Available methods:\n\n```php\n\u003c?php\n\n// First, instantiate response with your Msgraph mailbox (required):\n$msgraph = MsGraphMailer::mail(string $mailbox);\n\n// Add a main recipient(s), a subject and a content (required):\n$msgraph-\u003eto(array $toRecipient);\n$msgraph-\u003esubject(string $subject);\n$msgraph-\u003econtent(string $contentHTML);\n\n// You can add Cc and/or bcc with the same way (optionally):\n$msgraph-\u003ecc(array $ccRecipient);\n$msgraph-\u003ebcc(array $bccRecipient);\n\n// Optionally, you can add one or many attachments:\n$msgraph-\u003eaddAttachment(array $attachment = [\n    'name' =\u003e $filename,\n    'contentType' =\u003e $contentType,\n    'content' =\u003e $contentBytes\n]);\n// and repeat if you have many attachments.\n\n// Last, send your mail:\n$msgraph-\u003esend();\n```\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\n\u003e Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\n\u003e Feel free to contribute to this project to improve with new features or fix bugs 👍\n\n## Credits\n\n-   [Jordan](https://github.com/jornatf)\n-   [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT).\n\n\u003e Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjornatf%2Fmsgraph-mailer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjornatf%2Fmsgraph-mailer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjornatf%2Fmsgraph-mailer/lists"}