Download the PHP package mailengin/mailengin-php without Composer

On this page you can find all versions of the php package mailengin/mailengin-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mailengin-php

MailEngin PHP SDK

PHP Composer

The official PHP SDK for sending transactional email through MailEngin. It provides typed request and response objects, Guzzle integration, configurable timeouts, and structured exceptions.

[!IMPORTANT] This package is for server-side applications only. Never expose a MailEngin API key in JavaScript, browser, mobile, or other client-distributed code.

Requirements

Installation

Before You Send

  1. Verify a sending domain.
  2. Create an API key and save the full secret.
  3. Create and publish a Developer Template.
  4. Copy the template API name, such as welcome-email.

Store the API key in your server's secret manager or environment:

MailEngin displays the full key only once. A masked key cannot authenticate requests.

Quick Start

The published template supplies the subject and HTML. Values in variables replace matching template variables such as {{first_name}}.

Send One Email

Send request fields

Constructor argument Type Required Description
to string Yes Recipient email address.
templateName ?string Recommended Published template API name or exact display name.
templateId ?string No Legacy template identifier. Prefer templateName.
variables ?array No Values used to render template variables.
subject ?string Raw HTML only Template subject override, or required subject for raw HTML.
fromEmail ?string Recommended Sender on a verified domain authorized for the API key.
html ?string Advanced Raw HTML used when no template is supplied.
replyToMailEngin ?bool No Route recipient replies into the MailEngin inbox.

Exactly one content source is required: templateName, templateId, or html. Raw HTML sends also require subject.

Send Personalized Bulk Email

Bulk requests support up to 1,000 recipients. Request-level variables apply to every recipient; recipient variables take precedence.

For the same content without recipient-specific variables, use strings:

A successful bulk response confirms that recipients were queued. It is not a guarantee that every message was delivered.

Send Raw HTML

Published templates are recommended for reusable product email. For a one-off message, provide both subject and html:

Sender Selection

MailEngin resolves the sender in this order:

  1. fromEmail supplied in the request.
  2. Sender saved in the published Developer Template.
  3. noreply@<authorized-domain> fallback.

The sender domain must be verified and authorized for the API key. Set the sender in the template or request for predictable production sends.

Error Handling

API, timeout, malformed-response, and network failures throw MailEnginError:

isRetryable() returns true for network errors, timeouts, HTTP 408, HTTP 429, and 5xx responses. The SDK never retries sends automatically because a retry could create a duplicate email until idempotency keys are supported.

Invalid local input, such as an empty recipient or raw HTML without a subject, throws InvalidArgumentException before an API request is made.

Configuration

Constructor argument Default Description
apiKey None Full server-side MailEngin API key.
baseUrl https://api.mailengin.app Override for local, test, or dedicated environments.
timeout 30.0 Request timeout in seconds.
httpClient New Guzzle client Injectable PSR-compatible ClientInterface implementation.

Framework Integration

Create one client in your dependency-injection container and reuse it. For example, a Laravel service provider can register a singleton:

Configuration belongs in config/services.php, backed by MAILENGIN_API_KEY; do not commit the secret to source control.

Testing With an Injected Client

Use Guzzle's mock handler to test your integration without a real API key or network request:

Development

See PUBLISHING.md for maintainer release instructions.

Resources

License

Released under the MIT License. Copyright 2026 MailEngin.


All versions of mailengin-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
guzzlehttp/guzzle Version ^7.8
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mailengin/mailengin-php contains the following files

Loading the files please wait ...