{"id":19458856,"url":"https://github.com/leafsphp/mail","last_synced_at":"2025-04-25T06:30:36.651Z","repository":{"id":57013271,"uuid":"408118063","full_name":"leafsphp/mail","owner":"leafsphp","description":"📩 Leaf PHP mailer module","archived":false,"fork":false,"pushed_at":"2024-11-30T00:20:15.000Z","size":16,"stargazers_count":6,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"next","last_synced_at":"2025-04-13T04:28:40.596Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://leafphp.dev/modules/mail/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leafsphp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"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},"funding":{"open_collective":"leaf","github":"leafsphp"}},"created_at":"2021-09-19T12:12:43.000Z","updated_at":"2024-11-29T17:02:05.000Z","dependencies_parsed_at":"2022-08-21T15:10:09.005Z","dependency_job_id":"92281150-ce5a-481c-bf71-ed61a852f6c4","html_url":"https://github.com/leafsphp/mail","commit_stats":{"total_commits":13,"total_committers":2,"mean_commits":6.5,"dds":"0.15384615384615385","last_synced_commit":"a8a3f5e6c95981f4378a27010faf8563518410d7"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafsphp%2Fmail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafsphp%2Fmail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafsphp%2Fmail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafsphp%2Fmail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leafsphp","download_url":"https://codeload.github.com/leafsphp/mail/tar.gz/refs/heads/next","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250148459,"owners_count":21382798,"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":[],"created_at":"2024-11-10T17:28:45.710Z","updated_at":"2025-04-25T06:30:36.410Z","avatar_url":"https://github.com/leafsphp.png","language":"PHP","readme":"\u003c!-- markdownlint-disable no-inline-html --\u003e\n\u003cp align=\"center\"\u003e\n  \u003cbr\u003e\u003cbr\u003e\n  \u003cimg src=\"https://leafphp.netlify.app/assets/img/leaf3-logo.png\" height=\"100\"/\u003e\n  \u003ch1 align=\"center\"\u003eLeaf Mail Module\u003c/h1\u003e\n  \u003cbr\u003e\u003cbr\u003e\n\u003c/p\u003e\n\n# Leaf Mail v2\n\n[![Latest Stable Version](https://poser.pugx.org/leafs/mail/v/stable)](https://packagist.org/packages/leafs/mail)\n[![Total Downloads](https://poser.pugx.org/leafs/mail/downloads)](https://packagist.org/packages/leafs/mail)\n[![License](https://poser.pugx.org/leafs/mail/license)](https://packagist.org/packages/leafs/mail)\n\nMailing in PHP apps has always been seen as a daunting task. Leaf Mail provides a simple, straightforward and efficient email API that is built on the widely used PHPMailer Library component.\n\nWith Leaf Mail, you can easily send emails using various drivers and services such as SMTP, Mailgun, SendGrid, Amazon SES, and sendmail. This flexibility enables you to swiftly begin sending emails through a preferred local or cloud-based service.\n\n## Installation\n\nYou can install leaf mail using the leaf cli:\n\n```bash\nleaf install mail\n```\n\nor with composer:\n\n```bash\ncomposer require leafs/mail\n```\n\n## Basic Usage\n\nLeaf Mail provides a Mailer class that is responsible for validating and sending emails. This class handles the connection to your mail server, the configuration for how to send your emails and the actual sending of emails.\n\nIt also provides a mailer() method that is responsible for creating and formatting emails. Most of the time, you'll be using the mailer() method to create and send emails.\n\nNote that you need to setup the connection to your mail server using the Leaf\\Mail\\Mailer class before sending your emails.\n\n### Configure your mailer\n\n```php\nuse Leaf\\Mail\\Mailer;\nuse PHPMailer\\PHPMailer\\PHPMailer;\n\n...\n\nMailer::connect([\n  'host' =\u003e 'smtp.mailtrap.io',\n  'port' =\u003e 2525,\n  'charSet' =\u003e PHPMailer::CHARSET_UTF8,\n  'security' =\u003e PHPMailer::ENCRYPTION_STARTTLS,\n  'auth' =\u003e [\n    'username' =\u003e 'MAILTRAP_USERNAME',\n    'password' =\u003e 'MAILTRAP_PASSWORD'\n  ]\n]);\n```\n\n### Send your mails\n\n```php\nmailer()\n  -\u003ecreate([\n    'subject' =\u003e 'Leaf Mail Test',\n    'body' =\u003e 'This is a test mail from Leaf Mail using gmail',\n\n    // next couple of lines can be skipped if you\n    // set defaults in the Mailer config\n    'recipientEmail' =\u003e 'name@mail.com',\n    'recipientName' =\u003e 'First Last',\n    'senderName' =\u003e 'Leaf Mail',\n    'senderEmail' =\u003e 'mychi@leafphp.dev',\n  ])\n  -\u003esend();\n```\n","funding_links":["https://opencollective.com/leaf","https://github.com/sponsors/leafsphp"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleafsphp%2Fmail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleafsphp%2Fmail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleafsphp%2Fmail/lists"}