{"id":15296505,"url":"https://github.com/ceusmedia/mail","last_synced_at":"2026-02-16T08:33:21.368Z","repository":{"id":33312963,"uuid":"36957705","full_name":"CeusMedia/Mail","owner":"CeusMedia","description":"Use PHP to send mails via SMTP and read mails via IMAP.","archived":false,"fork":false,"pushed_at":"2025-03-22T03:13:09.000Z","size":1061,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-02T01:04:06.127Z","etag":null,"topics":["email","imap","imap-checker","imap-library","mail","method-chaining","php","php81","smtp","smtp-client","smtp-library","smtp-mail","smtp-protocol"],"latest_commit_sha":null,"homepage":"https://ceusmedia.de/","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/CeusMedia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2015-06-05T22:05:35.000Z","updated_at":"2023-11-29T00:00:54.000Z","dependencies_parsed_at":"2023-11-21T03:27:04.731Z","dependency_job_id":"3bffef8d-7530-4d7a-8221-582de3e87e91","html_url":"https://github.com/CeusMedia/Mail","commit_stats":{"total_commits":373,"total_committers":4,"mean_commits":93.25,"dds":"0.10723860589812328","last_synced_commit":"830354b8706301eac2ca1896c61ffa18abf3fa17"},"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CeusMedia%2FMail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CeusMedia%2FMail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CeusMedia%2FMail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CeusMedia%2FMail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CeusMedia","download_url":"https://codeload.github.com/CeusMedia/Mail/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252818677,"owners_count":21808896,"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","imap","imap-checker","imap-library","mail","method-chaining","php","php81","smtp","smtp-client","smtp-library","smtp-mail","smtp-protocol"],"created_at":"2024-09-30T18:10:58.882Z","updated_at":"2026-02-16T08:33:21.316Z","avatar_url":"https://github.com/CeusMedia.png","language":"PHP","readme":"# Ceus Media Mail Library\n\nProduce, send and read mails using PHP + IMAP \u0026 SMTP.\n\n[![Latest Stable Version](https://poser.pugx.org/ceus-media/mail/v)](//packagist.org/packages/ceus-media/mail)\n[![Total Downloads](https://poser.pugx.org/ceus-media/mail/downloads)](//packagist.org/packages/ceus-media/mail)\n[![License](https://poser.pugx.org/ceus-media/mail/license)](//packagist.org/packages/ceus-media/mail)\n\u003ca href=\"https://phpstan.org/\"\u003e\u003cimg src=\"https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat\" alt=\"PHPStan Enabled\"\u003e\u003c/a\u003e\n\n----\n\n## Features\n- Programming\n  - simple, easy, clean\n  - PHP 7.3+, object oriented style, chainable\n  - automatic encoding\n  - automatic MIME type detection\n- MIME Contents\n  - HTML\n  - plain text\n  - file attachments\n  - inline images\n- Partipicants\n  - To, Cc, Bcc\n  - sender and receiver names\n- Transports\n  - SMTP, with TLS support\n  - local PHP mail function\n- Mailbox\n  - access via IMAP and POP3\n  - search with criteria\n- Checks\n  - address validity\n  - receiver reachability\n\n## Code Examples\n\n### Short version\n\nThis example shows how to send a text mail using chainability.\n\n```php\n\\CeusMedia\\Mail\\Transport\\SMTP::getInstance(\"example.com\", 587)\n\t-\u003esetAuth(\"john@example.com\", \"my_password\")\n\t-\u003esend(\\CeusMedia\\Mail\\Message::getInstance()\n\t\t-\u003esetSender(\"john@example.com\", \"John Doe\")\n\t\t-\u003eaddRecipient(\"mike@example.com\", \"Mike Foo\")\n\t\t-\u003esetSubject(\"This is just a test\")\n\t\t-\u003eaddText(\"Test Message...\")\n\t);\n```\n\n### Long version\n\n```php\nuse \\CeusMedia\\Mail\\Message;\nuse \\CeusMedia\\Mail\\Transport\\SMTP;\n\n$message\t= new Message();\n$message-\u003esetSender(\"john@example.com\", \"John Doe\");\n$message-\u003eaddRecipient(\"mike@example.com\", \"Mike Foo\");\n$message-\u003eaddRecipient(\"log@example.com\", NULL, 'cc');\n$message-\u003eaddRecipient(\"spy@example.com\", NULL, 'bcc' );\n\n$message-\u003esetSubject(\"This is just a test\");\n$message-\u003eaddText(\"Test Message...\");\n$message-\u003eaddHTML('\u003ch2\u003e\u003cimg src=\"CID:logo\"/\u003e\u003cbr\u003eTest Message\u003c/h2\u003e');\n$message-\u003eaddInlineImage(\"logo\", \"logo.png\");\n$message-\u003eaddFile(\"readme.md\");\n\n$transport\t= new SMTP(\"example.com\", 587);\n$transport-\u003esetUsername(\"john@example.com\");\n$transport-\u003esetPassword(\"my_password\");\n$transport-\u003esetVerbose(TRUE);\n$transport-\u003esend( $message );\n```\n\n## Future plans\n- documentation for already existing parser\n- automatic virus scan\n- support for logging\n- factories and other design patterns\n- slim API - see \"Future version\"\n\n### Future version\n\nSending a mail should be as easy as possible.\nThis is an outlook how the interface could look like in future.\n\n**Attention:** This is pseudo code. The used classes are not implemented yet.\n\n```php\nuse \\CeusMedia\\Mail\\Client;\n\nClient::getInstance(\"This is just a test\")\n\t-\u003efrom(\"john@example.com\", \"John Doe\")\n\t-\u003eto(\"mike@example.com\", \"Mike Foo\")\n\t-\u003ebcc(\"spy@example.com\")\n\t-\u003etext(\"Test Message...\")\n\t-\u003eauth(\"my_password\")\n\t-\u003eport(587),\n\t-\u003eerror(\"handleMailException\")\n\t-\u003esend();\n\nfunction handleMailException( $e ){\n//  ...\n}\n```\n\n#### Thoughts on this example\n- Sending mail with this short code will be using SMTP, only.\n- The SMTP server will be determined by fetching MX records of the user's domain.\n- Setting the SMTP server port is still needed.\n- Assigned receivers will be checked for existance automatically.\n- If the auth method is receiving only one parameter, it will be understood as password.\n- The auth username will be taken from sender address.\n- Thrown exceptions can be catched by a defined error handler.\n- If everything is set the mail can be sent.\n\n\n#### Good to know\n\n##### Using Google as SMTP\n\nGoogle tried to protect its SMTP access by several measures.\nIf you are [having problems](https://support.google.com/accounts/answer/6009563) sending mails using Google SMTP, tried [these steps](https://serverfault.com/a/745666):\n\n1. Open a browser an log into Google using a Google account.\n2. [Allow \"less secure apps\"](https://www.google.com/settings/security/lesssecureapps) to have access.\n3. [Allow app](https://accounts.google.com/DisplayUnlockCaptcha) to have access.\n4. Try again!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceusmedia%2Fmail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fceusmedia%2Fmail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceusmedia%2Fmail/lists"}