{"id":28493773,"url":"https://github.com/trikko/postino","last_synced_at":"2026-01-30T00:38:25.614Z","repository":{"id":295982597,"uuid":"991919016","full_name":"trikko/postino","owner":"trikko","description":"A simple and secure SMTP library for D with support for MIME email, HTML mail with embedded files and attachments","archived":false,"fork":false,"pushed_at":"2025-05-28T16:31:05.000Z","size":1200,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-08T09:39:05.528Z","etag":null,"topics":["d","dlang","email","email-sender","mail","smtp"],"latest_commit_sha":null,"homepage":"","language":"D","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/trikko.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-28T10:48:29.000Z","updated_at":"2025-06-06T21:14:31.000Z","dependencies_parsed_at":"2025-05-28T13:31:02.140Z","dependency_job_id":null,"html_url":"https://github.com/trikko/postino","commit_stats":null,"previous_names":["trikko/quickmail","trikko/postino"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/trikko/postino","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trikko%2Fpostino","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trikko%2Fpostino/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trikko%2Fpostino/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trikko%2Fpostino/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trikko","download_url":"https://codeload.github.com/trikko/postino/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trikko%2Fpostino/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264259593,"owners_count":23580840,"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":["d","dlang","email","email-sender","mail","smtp"],"created_at":"2025-06-08T09:31:09.394Z","updated_at":"2026-01-30T00:38:20.579Z","avatar_url":"https://github.com/trikko.png","language":"D","funding_links":[],"categories":[],"sub_categories":[],"readme":"# postino\n\n*(italian word for «postman»)*\n\nA simple and secure MIME email library for D with support for HTML, attachments, and embedded files.\n\n## Features\n\n- 🚀 **Simple API** - Send emails with just a few lines of code\n- 📧 **MIME Support** - Full multipart/alternative and multipart/related support\n- 📎 **Attachments** - Support for file attachments and embedded images\n- 🎨 **HTML Emails** - Send rich HTML emails with embedded images\n\n## Quick Start\n\n### Installation\n\nAdd postino to your `dub.json` or use DUB directly:\n\n```bash\ndub add postino\n```\n\n### Basic Usage\n\n```d\nimport postino;\n\nvoid main()\n{\n   auto email = new Email();\n\n   // Method chaining\n   email\n   .setFrom(\"sender@example.com\", \"John Doe\")\n   .addTo(\"recipient@example.com\", \"Jane Smith\")\n   .setSubject(\"Hello from postino!\")\n   .setPlainTextBody(\"Hello, this is a plain text email.\")\n   .setHtmlBody(\"\u003ch1\u003eHello!\u003c/h1\u003e\u003cp\u003eThis is an \u003cb\u003eHTML\u003c/b\u003e email.\u003c/p\u003e\")\n   .send(\"smtps://smtp.example.com:465\", \"username\", \"password\");\n}\n```\n\n## Advanced Examples\n\n### HTML Email with Embedded Image\n\n```d\n   new Email()\n   .setFrom(\"newsletter@example.com\", \"Company Newsletter\")\n   .addTo(\"customer@example.com\", \"Valued Customer\")\n   .setSubject(\"Monthly Newsletter\")\n   .setHtmlBody(`\n      \u003chtml\u003e\n      \u003cbody\u003e\n         \u003ch1\u003eWelcome to our Newsletter!\u003c/h1\u003e\n         \u003cp\u003eCheck out our latest product:\u003c/p\u003e\n         \u003cimg src=\"cid:product-image\" alt=\"New Product\" width=\"300\"\u003e\n         \u003cp\u003eBest regards,\u003cbr\u003eThe Team\u003c/p\u003e\n      \u003c/body\u003e\n      \u003c/html\u003e\n   `)\n   .addEmbeddedFile(\"/path/to/product.png\", \"product-image\")\n   .send(\"smtps://smtp.example.com:465\", \"username\", \"password\");\n```\n\n### Multiple Recipients with Attachments\n\n```d\n   new Email()\n   .setFrom(\"reports@example.com\", \"Automated Reports\")\n   .addTo(\"manager@example.com\", \"Project Manager\")\n   .addTo(\"team@example.com\", \"Development Team\")\n   .addCc(\"archive@example.com\")\n   .setSubject(\"Weekly Report\")\n   .setPlainTextBody(\"Please find the weekly report attached.\")\n   .addAttachment(\"/path/to/report.pdf\")\n   .addAttachment(\"/path/to/data.xlsx\")\n   .send(\"smtp://internal-smtp.example.com:25\");\n```\n\n### Newsletter with Multiple Features\n\n```d\nnew Email()\n    .setFrom(\"marketing@example.com\", \"Marketing Team\")\n    .addTo(\"subscriber1@example.com\", \"John Doe\")\n    .addTo(\"subscriber2@example.com\", \"Jane Smith\")\n    .addBcc(\"analytics@example.com\")\n    .setReplyTo(\"support@example.com\", \"Customer Support\")\n    .setSubject(\"🎉 Special Offer Inside!\")\n    .setPlainTextBody(\"Visit our website for a special 20% discount!\")\n    .setHtmlBody(`\n        \u003chtml\u003e\n        \u003cbody style=\"font-family: Arial, sans-serif;\"\u003e\n            \u003ch1\u003e🎉 Special Offer!\u003c/h1\u003e\n            \u003cp\u003eGet \u003cstrong\u003e20% off\u003c/strong\u003e your next purchase!\u003c/p\u003e\n            \u003cimg src=\"cid:banner\" alt=\"Special Offer\" style=\"max-width: 100%;\"\u003e\n            \u003cp\u003e\u003ca href=\"https://example.com/offer\"\u003eShop Now\u003c/a\u003e\u003c/p\u003e\n        \u003c/body\u003e\n        \u003c/html\u003e\n    `)\n    .addEmbeddedFile(\"/path/to/banner.jpg\", \"banner\")\n    .addAttachment(\"/path/to/catalog.pdf\")\n    .send(\"smtps://smtp.example.com:587\", \"marketing@example.com\", \"password\");\n```\n\n## API Reference\n\n### Email Configuration (Chainable)\n\n| Method | Description |\n|--------|-------------|\n| `setFrom(address, name?)` | Set sender email and optional display name |\n| `addTo(address, name?)` | Add recipient to \"To\" field |\n| `addCc(address, name?)` | Add recipient to \"Cc\" field |\n| `addBcc(address, name?)` | Add recipient to \"Bcc\" field |\n| `setReplyTo(address, name?)` | Set reply-to address |\n| `setSubject(subject)` | Set email subject |\n\n### Content (Chainable)\n\n| Method | Description |\n|--------|-------------|\n| `setPlainTextBody(text)` | Set plain text content |\n| `setHtmlBody(html)` | Set HTML content |\n| `addAttachment(path, mimeType?)` | Add file attachment |\n| `addEmbeddedFile(path, cid, mimeType?)` | Add embedded file for HTML |\n\n### Sending and saving\n\n| Method | Description |\n|--------|-------------|\n| `send(smtpUrl, username?, password?)` | Send email via SMTP |\n| `save(path)` | Save email as a .eml file |\n\n\n## SMTP Configuration\n\npostino supports various SMTP configurations:\n\n```d\n// Gmail with app password\nemail.send(\"smtps://smtp.gail.com:465\", \"user@gmail.com\", \"app-password\");\n\n// Outlook/Hotmail\nemail.send(\"smtps://smtp-mail.outlook.com:587\", \"user@outlook.com\", \"password\");\n\n// Local SMTP server (no auth)\nemail.send(\"smtp://localhost:25\");\n\n// Custom SMTP with TLS\nemail.send(\"smtps://mail.example.com:465\", \"user\", \"pass\");\n```\n\n## License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrikko%2Fpostino","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrikko%2Fpostino","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrikko%2Fpostino/lists"}