PHP
Overview
Mailtrap can be integrated with PHP apps and projects for email sending.
Email API/SMTP for PHP
SDK integration
The Mailtrap PHP SDK is a modern, type-safe library for sending transactional and bulk emails from PHP applications. The SDK supports:
Transactional email sending
Batch email sending
Template management
Contact management
Sandbox testing
Account management
Additionally, you can watch the course released by Symfony Casts for a step-by-step integration walkthrough.
Installation
Install the SDK using Composer:
Minimal Example
Here's a minimal example to send your first email:
SMTP integration
To integrate SMTP with your PHP app, navigate to the Integrations tab, choose the desired PHP framework, and copy-paste the credentials or ready-made code snippets.

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 PHP 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?

