{"id":34370009,"url":"https://github.com/snipworks/php-smtp","last_synced_at":"2026-04-09T00:02:08.540Z","repository":{"id":17312219,"uuid":"20082956","full_name":"snipworks/php-smtp","owner":"snipworks","description":"Simple PHP SMTP Mail Send Script","archived":false,"fork":false,"pushed_at":"2020-09-06T10:15:16.000Z","size":27,"stargazers_count":85,"open_issues_count":6,"forks_count":45,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-09-21T05:57:49.121Z","etag":null,"topics":["php","smtp"],"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/snipworks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-23T01:33:11.000Z","updated_at":"2025-07-24T19:46:24.000Z","dependencies_parsed_at":"2022-09-14T22:40:52.102Z","dependency_job_id":null,"html_url":"https://github.com/snipworks/php-smtp","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/snipworks/php-smtp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snipworks%2Fphp-smtp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snipworks%2Fphp-smtp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snipworks%2Fphp-smtp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snipworks%2Fphp-smtp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snipworks","download_url":"https://codeload.github.com/snipworks/php-smtp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snipworks%2Fphp-smtp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31579058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["php","smtp"],"created_at":"2025-12-18T09:34:02.614Z","updated_at":"2026-04-09T00:02:08.535Z","avatar_url":"https://github.com/snipworks.png","language":"PHP","readme":"PHP SMTP\n========\n\nAn easy to use SMTP (Simple Mail Transfer Protocol) library which helps you to send emails.\n\n## Installation\n```bash\ncomposer require snipworks/php-smtp\n```\n\n## Examples\n### Unsecured\n```php\n\u003c?php\n\nuse Snipworks\\Smtp\\Email;\n\n$mail = new Email('smtp.example.com', 25);\n$mail-\u003esetLogin('sender@example.com', 'password');\n$mail-\u003eaddTo('recipient@example.com', 'Example Receiver');\n$mail-\u003esetFrom('example@example.com', 'Example Sender');\n$mail-\u003esetSubject('Example subject');\n$mail-\u003esetHtmlMessage('\u003cb\u003eExample message\u003c/b\u003e...');\n\nif($mail-\u003esend()){\n    echo 'Success!';\n} else {\n    echo 'An error occurred.';\n}\n\n```\n\n### Secured (TLS)\n```php\n\u003c?php\n\nuse Snipworks\\Smtp\\Email;\n\n$mail = new Email('smtp.example.com', 587);\n$mail-\u003esetProtocol(Email::TLS);\n$mail-\u003esetLogin('sender@example.com', 'password');\n$mail-\u003eaddTo('recipient@example.com', 'Example Receiver');\n$mail-\u003esetFrom('example@example.com', 'Example Sender');\n$mail-\u003esetSubject('Example subject');\n$mail-\u003esetHtmlMessage('\u003cb\u003eExample message\u003c/b\u003e...');\n\nif($mail-\u003esend()){\n    echo 'Success!';\n} else {\n    echo 'An error occurred.';\n}\n\n```\nIt's discouraged to hard-code the SMTP login credentials like in the examples above.\nIt's recommended to put them inside another file and load it or set it to environment variable \n```php\n\u003c?php\n\n// config.php\n\ndefine('SMTP_PRIMARY_EMAIL', 'sender@example.com');\ndefine('SMTP_PRIMARY_PASSWORD', 'my very secret password');\n```\n\n```php\n\u003c?php\n\nrequire_once('config.php');\n// ...\n$mail-\u003esetLogin(SMTP_PRIMARY_EMAIL, SMTP_PRIMARY_PASSWORD);\n// ...\n```\n\n\nIt's also recommended to put the config outside the public web root if possible. \nThis for example prevents people from including your PHP file remotely by a misconfiguration.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnipworks%2Fphp-smtp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnipworks%2Fphp-smtp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnipworks%2Fphp-smtp/lists"}