{"id":31711019,"url":"https://github.com/railsware/mailtrap-java","last_synced_at":"2025-10-09T00:53:00.638Z","repository":{"id":312157294,"uuid":"807728301","full_name":"railsware/mailtrap-java","owner":"railsware","description":"Official mailtrap.io Java client","archived":false,"fork":false,"pushed_at":"2025-10-07T21:51:56.000Z","size":429,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-10-07T23:35:56.067Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://mailtrap.io","language":"Java","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/railsware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-05-29T16:54:25.000Z","updated_at":"2025-09-28T18:06:45.000Z","dependencies_parsed_at":"2025-08-29T02:46:36.332Z","dependency_job_id":"f324e2b3-4059-4908-b314-cd7d87b00370","html_url":"https://github.com/railsware/mailtrap-java","commit_stats":null,"previous_names":["railsware/mailtrap-java"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/railsware/mailtrap-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railsware%2Fmailtrap-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railsware%2Fmailtrap-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railsware%2Fmailtrap-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railsware%2Fmailtrap-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/railsware","download_url":"https://codeload.github.com/railsware/mailtrap-java/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railsware%2Fmailtrap-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000641,"owners_count":26082879,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-10-09T00:52:57.625Z","updated_at":"2025-10-09T00:53:00.633Z","avatar_url":"https://github.com/railsware.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Java](https://badgen.net/badge/icon/Java?icon=java\u0026label=) \n\n# Official Mailtrap Java client\n\nThis SDK offers integration with the [official API](https://api-docs.mailtrap.io/) for [Mailtrap](https://mailtrap.io).\n\nQuickly add email sending functionality to your Java application with Mailtrap.\n\n## Java Version\n\nRequires JDK 11 or higher.\n\n## Install package\n\nAs Maven dependency:\n\n```xml\n\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.mailtrap\u003c/groupId\u003e\n    \u003cartifactId\u003emailtrap-java\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nAs Gradle Groovy dependency:\n\n```groovy\nimplementation 'io.mailtrap:mailtrap-java:1.0.0'\n```\n\nAs Gradle Kotlin DSL dependency:\n\n```kotlin\nimplementation(\"io.mailtrap:mailtrap-java:1.0.0\")\n```\n\n## Usage\n\n### Minimal\n\n```java\nimport io.mailtrap.client.MailtrapClient;\nimport io.mailtrap.config.MailtrapConfig;\nimport io.mailtrap.factory.MailtrapClientFactory;\nimport io.mailtrap.model.request.emails.Address;\nimport io.mailtrap.model.request.emails.MailtrapMail;\n\nimport java.util.List;\n\npublic class MailtrapJavaSDKTest {\n\n    private static final String TOKEN = \"\u003cYOUR MAILTRAP TOKEN\u003e\";\n    private static final String SENDER_EMAIL = \"sender@domain.com\";\n    private static final String RECIPIENT_EMAIL = \"recipient@domain.com\";\n    private static final String REPLY_TO_EMAIL = \"reply_to@domain.com\";\n\n    public static void main(String[] args) {\n        final MailtrapConfig config = new MailtrapConfig.Builder()\n                .token(TOKEN)\n                .build();\n\n        final MailtrapClient client = MailtrapClientFactory.createMailtrapClient(config);\n\n        final MailtrapMail mail = MailtrapMail.builder()\n                .from(new Address(SENDER_EMAIL))\n                .to(List.of(new Address(RECIPIENT_EMAIL)))\n                .replyTo(new Address(REPLY_TO_EMAIL, \"Vincent Vega\"))\n                .subject(\"Hello from Mailtrap Sending!\")\n                .text(\"Welcome to Mailtrap Sending!\")\n                .build();\n\n        // Send email using Mailtrap Sending API\n        try {\n            System.out.println(client.send(mail));\n        } catch (Exception e) {\n            System.out.println(\"Caught exception : \" + e);\n        }\n\n        // Or send email using Mailtrap Testing API\n        try {\n            long inboxId = 1000001L;\n\n            // Either instantiate a new client\n            MailtrapClient sandboxClient = MailtrapClientFactory.createMailtrapClient(\n                    new MailtrapConfig.Builder()\n                            .sandbox(true)\n                            .inboxId(inboxId)\n                            .token(TOKEN)\n                            .build());\n\n            System.out.println(sandboxClient.send(mail));\n\n            // Or reuse already created client\n            client.switchToEmailTestingApi(inboxId);\n\n            System.out.println(client.send(mail));\n\n            // Or use Testing API directly\n            System.out.println(client.testingApi().emails().send(mail, inboxId));\n        } catch (Exception e) {\n            System.out.println(\"Caught exception : \" + e);\n        }\n    }\n}\n```\n\nRefer to the [`examples`](examples) folder for the source code of this and other advanced examples.\n\n### API Reference\n\nYou can find the API reference [here](https://railsware.github.io/mailtrap-java/index.html).\n\n### General API\n\n- [List User \u0026 Invite account accesses](examples/java/io/mailtrap/examples/general/AccountAccessExample.java)\n- [Remove account access](examples/java/io/mailtrap/examples/general/AccountsExample.java)\n- [Permissions](examples/java/io/mailtrap/examples/general/PermissionsExample.java)\n- [Current billing usage cycle](examples/java/io/mailtrap/examples/general/BillingExample.java)\n\n### Sending API\n\n- [Advanced](examples/java/io/mailtrap/examples/sending/EverythingExample.java)\n- [Minimal](examples/java/io/mailtrap/examples/sending/MinimalExample.java)\n- [Error handling](examples/java/io/mailtrap/examples/sending/ErrorsExample.java)\n- [Send email using template](examples/java/io/mailtrap/examples/sending/TemplateExample.java)\n\n### Email Testing API\n\n- [Attachments](examples/java/io/mailtrap/examples/testing/AttachmentsExample.java)\n- [Inboxes](examples/java/io/mailtrap/examples/testing/InboxesExample.java)\n- [Messages](examples/java/io/mailtrap/examples/testing/MessagesExample.java)\n- [Projects](examples/java/io/mailtrap/examples/testing/ProjectsExample.java)\n- [Send mail using template](examples/java/io/mailtrap/examples/testing/EmailExample.java)\n\n### Bulk Sending API\n\n- [Send mail](examples/java/io/mailtrap/examples/bulk/BulkSendExample.java)\n\n### Contacts API\n\n- [Contacts](examples/java/io/mailtrap/examples/contacts/ContactsExample.java)\n- [Contact lists](examples/java/io/mailtrap/examples/contactlists/ContactListsExample.java)\n\n## Contributing\n\nBug reports and pull requests are welcome on [GitHub](https://github.com/railsware/mailtrap-java). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](CODE_OF_CONDUCT.md).\n\n## License\n\nThe package is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Mailtrap project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frailsware%2Fmailtrap-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frailsware%2Fmailtrap-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frailsware%2Fmailtrap-java/lists"}