Java

Mailtrap Java SDK on GitHub

Overview

Mailtrap can be integrated with Java apps and projects for email sending with SDK, SMTP, and RESTful API.

Email API/SMTP for Java

SDK integration

The Mailtrap Java SDK is a robust, enterprise-ready library for sending transactional and bulk emails from Java applications. The SDK supports:

  • Transactional email sending

  • Batch email sending

  • Template management

  • Contact management

  • Sandbox testing

  • Account management

  • Thread-safe operations

Installation

Add the SDK to your project using your preferred build tool:

Minimal Example

Here's a minimal example to send your first email:

Get your API token from your Mailtrap account under Settings → API Tokens.

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.

SMTP integration is compatible with any Java framework or library that sends emails via SMTP.

For more information, read the SMTP Integration article.

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.

Last updated

Was this helpful?