Download the PHP package mailkube/mailkube-php without Composer

On this page you can find all versions of the php package mailkube/mailkube-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 mailkube-php

mailkube-php

CI Packagist

The official PHP SDK for mailkube.

Full product and API documentation: docs.mailkube.com/sdks/php.

Install

Usage

The HTTP client

This package talks PSR-18 and ships no HTTP implementation of its own, so your application picks one. Any PSR-18 client plus PSR-17 factories you already have installed are discovered automatically:

Pass your own when you need it configured (proxies, retry middleware, a framework's container-bound client, or a test double):

Configuration

Option Constructor Environment Default
API key apiKey: MAILKUBE_API_KEY required
Base URL baseUrl: MAILKUBE_BASE_URL https://api.mailkube.com/mta/v1/
Timeout timeout: 30 seconds
Logger logger: (PSR-3) MAILKUBE_LOG silent
User-Agent suffix userAgentSuffix: none

About the User-Agent suffix. If your code wraps this SDK — a CLI, an internal service, a framework integration — pass a name/version token and it is appended to the SDK's own, after a single space: mailkube-php/1.1.0 mailkube-laravel/0.1.0. This SDK's token always leads. Surrounding whitespace is trimmed, and a value containing CR or LF is ignored rather than cleaned up, because a header value that could split the request is not one this package will send.

About the timeout. PSR-18 exposes no timeout API, so the value can only reach a concrete client. Pass no httpClient: and the SDK builds a Guzzle or Symfony client carrying it. Inject your own client and it keeps whatever timeout you configured on it.

There are no built-in retries. A RateLimitException carries retryAfter and a ServerException is safe to retry with backoff, so the calling application decides. Pass idempotencyKey: to make a retry safe.

Errors

Every error extends MailkubeException. Transport failures raise ConnectionException; server errors raise an ApiException subclass chosen by status (BadRequestException, AuthenticationException, NotFoundException, ConflictException, InvalidRequestException, RateLimitException, ServerException), each carrying errorName, message, statusCode, retryAfter and requestId. Quote requestId when you report a failed request to support: it identifies the exact request server-side.

Tags

Attach free-form name/value tags to a send. The server denormalizes them onto the sending log, so you can filter, export and dashboard by tag, and they ride along on delivery webhooks.

Validation is server-side: names and values are limited to [A-Za-z0-9_-], a name to 16 characters and a value to 32, at most 20 tags per send, names unique. Tag values are not encrypted, so keep personal data out of them.

Scheduling

Pass scheduledAt: to have the message delivered later instead of now. The send is acknowledged 202, $email->isScheduled() is true, and the message is manageable until it is due.

scheduledAt: accepts a DateTimeInterface or an ISO-8601 string with an offset.

Managing scheduled emails

list() returns one page: $page->data, $page->pagination and $page->hasMore(). To walk every page, use iterAll(), which follows the links the server issues and fetches lazily, so abandoning it early costs nothing:

Note $email->recipients is a summary string ("[email protected] +2"), not a list: the full recipient set stays server-side with the frozen payload.

Batches

A batchId groups scheduled sends so they move or cancel together.

Scheduling errors

errorName Status Meaning
scheduling_not_included 403 The plan does not include scheduled sending
scheduled_email_not_found 404 No such scheduled email, or it is not yours
scheduled_email_not_pending 422 Already sent or canceled, so it can no longer be modified
validation_error 422 A bad due time, an inverted range, or a batchId over 64 characters

The scheduling rules are server-enforced and not validated client-side: the due time must be in the future and within your plan's horizon (about 30 days), the list window covers roughly 31 days around now, and a batch label is at most 64 characters. The horizon and window are configurable per environment; the batch-label limit is fixed.

Your API key

$client->credential->info() describes the key the client authenticates with: its domain, organization, source-IP allowlist, plan and send-quota usage.

The key is checked exactly as a send checks it, so a key that cannot send raises AuthenticationException (invalid_api_key): calling info() is how to verify a key. The call counts as a use of the key, and plan and quota figures can be up to 30 seconds old. plan is null when the organization has no subscription, and a plan without a daily limit lists emails_per_month only. remaining counts recipients, not messages.

The client keeps the key it was constructed with. To use another key, construct another client.

Webhooks

Webhooks::verify() checks the signature over the raw request body and returns a typed event. Never decode then re-encode before verifying, or the signature will not match.

Webhooks::verifySignature() returns the raw bytes if you would rather decode them yourself, and Webhooks::parseEvent() parses without verifying (useful in tests).

Webhooks::sign() is the mirror, so your own tests can build a valid request without reimplementing the HMAC from this page:

See examples/sign_webhook.php, which signs a delivery and prints a fixture that examples/verify_webhook.php reads back.

Event types

Type Class data block
email.sent EmailSentEvent sent
email.delivered EmailDeliveredEvent delivery
email.bounced EmailBouncedEvent bounce
email.delivery_delayed EmailDeliveryDelayedEvent delay
email.suppressed EmailSuppressedEvent suppression
email.scheduled EmailScheduledEvent scheduled
email.failed EmailFailedEvent failed
email.opened EmailOpenedEvent open
email.clicked EmailClickedEvent click
domain.status DomainStatusEvent previous
webhook.status WebhookStatusEvent previous

email.sent means the sending infrastructure accepted the message; email.delivered means the receiving server took it. email.failed means it was dropped at dispatch and never transmitted, which is why it carries no recipient, unlike email.bounced.

On the open and click blocks, ipAddress, country and userAgent are recorded only where the sending domain has elected them, and both settings are off by default. The server omits the key rather than sending an empty value. $country is null when it was not recorded, while $ipAddress and $userAgent stay non-nullable and read as '', so on those two an unelected value is indistinguishable from a blank one. $country can be null even where the address was recorded, because it is resolved at the edge and is not available on every path.

An event type this release does not know becomes an UnknownEvent rather than an error, and every event keeps the whole decoded payload in $event->raw, so a receiver that logs or forwards events never loses a field. That is deliberate: the server gains event types independently of the SDK.

Logging

Silent by default. Pass any PSR-3 logger, or set MAILKUBE_LOG to a level:

MAILKUBE_LOG holds a level, not a flag: MAILKUBE_LOG=warning suppresses the SDK's request/response records, which are emitted at debug. The SDK logs the method, URL, redacted headers, response status and request id. It never logs a request or response body, and the Authorization and Idempotency-Key headers are always masked.

Extending this SDK

Before adding a verb, a resource, a paginated listing or a webhook event, read .rules/SDK_CONTRACT.md (the decisions every mailkube SDK shares) and .rules/SDK_DESIGN.md (how they are realized in PHP). Both carry a step-by-step checklist. emails.send is the worked example for a single verb, scheduledEmails for a CRUD resource with pagination and a sub-namespace, and src/Event/ for the webhook catalogue.

Runnable scripts live in examples/; every checklist ends with adding one.

Contributing

See CONTRIBUTING.md for the development setup and the quality gates every change must pass. Security issues: see SECURITY.md.

License

Apache-2.0 © 2026 Mail Tactic Corporation


All versions of mailkube-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^2.0
psr/log Version ^3.0
php-http/discovery Version ^1.19
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 mailkube/mailkube-php contains the following files

Loading the files please wait ...