Mailtrap Java integration
Mailtrap can be integrated with Java apps and projects for sending and/or testing purposes with SDK, SMTP, and RESTful API. Choose the one that suits your needs.
Email API/SMTP for Java
SDK integration
To integrate Mailtrap into your Java Java project, you can use the official SDK, which gives you access to both Transactional and Bulk Streams, and Templates. You can install it as a Maven, Gradle Groovy, or Gradle Kotlin DSL dependency.
SMTP integration
To integrate SMTP with your Java app, navigate to the Integrations tab and copy-paste the credentials or ready-made code snippet into your configuration.
Note that SMTP integration is compatible with any Java framework or library that sends emails via SMTP.
Read more about SMTP integration here.
RESTful API integration
To integrate Mailtrap using RESTful API, use the configuration available among Code samples under the API section.
API integration can be used with any Java framework or library that supports HTTP requests. For more details, refer to the API documentation.
Read more about API integration here.
Email Testing for Java
SDK integration
You can integrate Mailtrap with your Java project using the official SDK. Some of the examples can be found here.
SMTP integration
Within the Email Testing menu, navigate to the Inbox and find your SMTP credentials. Then, simply copy-paste them into your Java project.
You can integrate Email Testing with any Java framework or library that sends emails via SMTP.
Read more about Email Testing SMTP integration here.
RESTful API integration
To use Email Testing API, simply copy-paste the API endpoint and API token into the configuration file of any Java framework that supports HTTP requests.
For more details, refer to the API docs.