{"id":22941489,"url":"https://github.com/phicorp/mailbox","last_synced_at":"2025-04-01T20:48:51.536Z","repository":{"id":198958473,"uuid":"701897323","full_name":"phiCorp/mailbox","owner":"phiCorp","description":"mailBox: a tool for easier work with sending emails for the PHP language","archived":false,"fork":false,"pushed_at":"2023-10-07T22:24:32.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-09T21:41:14.704Z","etag":null,"topics":["mail","mailbox","phi","php"],"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/phiCorp.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-10-07T22:21:18.000Z","updated_at":"2024-06-14T13:14:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"ee59f857-41b1-4127-b460-d6f013307784","html_url":"https://github.com/phiCorp/mailbox","commit_stats":null,"previous_names":["phicorp/mailbox"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phiCorp%2Fmailbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phiCorp%2Fmailbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phiCorp%2Fmailbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phiCorp%2Fmailbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phiCorp","download_url":"https://codeload.github.com/phiCorp/mailbox/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246709914,"owners_count":20821298,"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":["mail","mailbox","phi","php"],"created_at":"2024-12-14T13:44:03.585Z","updated_at":"2025-04-01T20:48:51.513Z","avatar_url":"https://github.com/phiCorp.png","language":"PHP","readme":"# mailBox\n\nA tool for easier work with sending emails for the PHP language\n\n## Installation\n\nInstall Cipher with composer\n\n```bash\ncomposer require phicorp/mailbox\n```\n\n## Features\n\n- Easy to use\n- HTML sending support\n- SMTP support\n- And more features\n\n## Usage/Examples\n\n- Send a normal email\n\n```php\nuse mailBox\\mailBox;\n\n// Create an instance of mailBox with SMTP server details.\n$mailer = new mailBox('smtp.example.com', 587, 'STARTTLS');\n\n// Set SMTP authentication credentials.\n$mailer-\u003eauth('your_username', 'your_password');\n\n// Set sender information.\n$mailer-\u003esetFrom('your_email@example.com', 'Your Name');\n\n// Set recipient email.\n$mailer-\u003eto('recipient@example.com');\n\n// Set email subject and message.\n$mailer-\u003esubject('Hello, World!');\n$mailer-\u003emessage('This is a test email sent using mailBox class.');\n\n// Optionally, enable HTML email if needed.\n// $mailer-\u003eisHTML();\n\n// Send the email.\nif ($mailer-\u003esend()) {\n    echo \"Email sent successfully.\";\n} else {\n    echo \"Email sending failed.\";\n}\n\n// Optionally, you can retrieve the logs for debugging purposes.\n// $logs = $mailer-\u003egetLogs();\n```\n\n- If you want to use PHP's own built-in functions to send your email, you can use this method\n\n```php\nuse mailBox\\mailBox;\n\n// Create an instance of mailBox with SMTP server details.\n$mailer = new mailBox('your_smtp_host', 25, 'tls', 'your_username', 'your_password');\n\n// Set sender information.\n$mailer-\u003esetFrom('your_email@example.com', 'Your Name');\n\n// Set recipient email.\n$mailer-\u003eto('recipient@example.com');\n\n// Set email subject and message.\n$mailer-\u003esubject('Hello, World!');\n$mailer-\u003emessage('\u003cp\u003eThis is a test email sent using mailBox class.\u003c/p\u003e');\n\n// Enable HTML mode\n$mailer-\u003eisHTML();\n\n// Send the email.\n$result = $mailer-\u003esendRAW();\nif ($result) {\n    echo \"Email sent successfully using default mail() function.\";\n} else {\n    echo \"Email could not be sent using default mail() function.\";\n}\n\n```\n\n- Sending by Outlook, with method chaining\n\n```php\nmailBox::create('smtp.office365.com', 587)\n    -\u003eencryption('STARTTLS')\n    -\u003eauth('your_username@outlook.com', 'your_password')\n    -\u003esetFrom('your_username@outlook.com', 'your_name')\n    -\u003eto('recipient@example.com')\n    -\u003esubject(\"Hello, World!\")\n    -\u003emessage(\"This is a test email sent using mailBox class.\")\n    -\u003esend();\n```\n\n- Sending by Gmail, with method chaining and using helper function\n\n```php\nmailBox('smtp.gmail.com', 587)\n    -\u003eencryption('STARTTLS')\n    -\u003eauth('your_username@gmail.com', 'your_password')\n    -\u003esetFrom('your_username@gmail.com', 'your_name')\n    -\u003eto('recipient@example.com')\n    -\u003esubject(\"Hello, World!\")\n    -\u003emessage(\"\u003cp\u003eThis is a test email sent using mailBox class.\u003c/p\u003e\")-\u003eisHTML()\n    -\u003esend();\n```\n\n## Authors\n\n- [@thephibonacci](https://www.github.com/thephibonacci)\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphicorp%2Fmailbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphicorp%2Fmailbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphicorp%2Fmailbox/lists"}