Download the PHP package mailgun/mailgun-php without Composer
On this page you can find all versions of the php package mailgun/mailgun-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mailgun/mailgun-php
More information about mailgun/mailgun-php
Files in mailgun/mailgun-php
Package mailgun-php
Short Description The Mailgun SDK provides methods for all API functions.
License MIT
Rated 3.80 based on 5 reviews
Informations about the package mailgun-php
Mailgun PHP SDK
The official Mailgun PHP SDK — a clean, PSR-18 HTTP client wrapper around the Mailgun API.
Table of Contents
- Requirements
- Installation
- Quick Start
- Sending Email
- IP Management
- Dynamic IP Pools
- Analytics
- Subaccounts
- Response Handling
- Debugging
- Framework Integration
- Contributing
Requirements
- PHP 7.4 or higher
- A PSR-18 HTTP client (e.g.
symfony/http-client,guzzlehttp/guzzle) - A PSR-7 / PSR-17 implementation (e.g.
nyholm/psr7)
The SDK is not coupled to any specific HTTP library — bring your own PSR-18 client.
Installation
EU region? Use
https://api.eu.mailgun.netas your endpoint (see below).
Quick Start
Note: The
$domainyou pass to any API call must match a domain configured in app.mailgun.com.
Sending Email
Simple message
With attachments and tracking options
Scheduled delivery
IP Management
List all account IPs
Inspect a single IP
Assign / remove an IP on a specific domain
Bulk IP operations across all domains
Find all domains using a specific IP
Dedicated IP band
Request a new dedicated IP
Dynamic IP Pools (DIPP)
Dynamic IP Pools let you group dedicated IPs and link them to domains, so sending traffic is spread across all IPs in the pool automatically.
List and inspect pools
Create and configure a pool
Manage IPs inside a pool
When a pool is linked to domains, adding or removing IPs propagates to all linked domains asynchronously after the API responds.
List domains linked to a pool
Delete a pool
Delegate a pool to a subaccount
Analytics
Subaccounts
Make API calls on behalf of a subaccount
Response Handling
All API methods return typed model objects with IDE-friendly getters by default.
Array responses
Prefer raw arrays? Inject ArrayHydrator:
Raw PSR-7 response
Need the raw response? Use NoopHydrator — note: no exceptions are thrown on non-200 responses when using this hydrator.
Debugging
Route traffic through Mailgun's Postbin to inspect what the SDK sends:
Custom HTTP requests
Framework Integration
| Framework | Package |
|---|---|
| Symfony | tehplague/swiftmailer-mailgun-bundle |
| Yii2 | katanyoo/yii2-mailgun-mailer |
| CakePHP | narendravaghela/cakephp-mailgun |
| Drupal | drupal/mailgun |
| Laravel | Built-in — see Laravel Mail docs |
Contributing
This is an open-source project under the MIT license, maintained by Mailgun and the community.
Running the tests
Ways to help
- Test the
dev-masterbranch and open issues for anything broken - Review open pull requests
- Add tests for untested endpoints
- Improve documentation and examples
Support
- Documentation: documentation.mailgun.com
- Issues: GitHub Issues
- Account support: app.mailgun.com/support
- More examples: doc/examples.md
All versions of mailgun-php with dependencies
php-http/client-common Version ^2.2.1
php-http/discovery Version ^1.19
php-http/multipart-stream-builder Version ^1.1.2
psr/http-client Version ^1.0
psr/http-message Version ^1.0 || ^2.0
webmozart/assert Version ^1.9.1 || ^2.0