Download the PHP package postalsys/emailengine-php without Composer
On this page you can find all versions of the php package postalsys/emailengine-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download postalsys/emailengine-php
More information about postalsys/emailengine-php
Files in postalsys/emailengine-php
Package emailengine-php
Short Description Modern PHP SDK for EmailEngine - Send and receive emails via REST API
License MIT
Homepage https://emailengine.app
Informations about the package emailengine-php
EmailEngine PHP SDK
Modern PHP SDK for EmailEngine - the self-hosted email gateway that provides a REST API for IMAP and SMTP operations.
Requirements
- PHP 8.1 or higher
- Composer
- EmailEngine instance
Installation
Quick Start
Configuration
Constructor Parameters
Factory Method (Legacy Compatibility)
Resources
The SDK provides access to all EmailEngine API endpoints through resource classes:
| Resource | Description |
|---|---|
$client->accounts |
Account management (CRUD, sync, reconnect) |
$client->messages |
Message operations (list, read, send, search) |
$client->mailboxes |
Mailbox management (create, rename, delete) |
$client->outbox |
Queued message management |
$client->settings |
System and webhook settings |
$client->tokens |
Access token management |
$client->templates |
Email template management |
$client->gateways |
SMTP gateway configuration |
$client->oauth2 |
OAuth2 application management |
$client->webhooks |
Webhook route management |
$client->stats |
System statistics and utilities |
$client->blocklists |
Blocklist management |
Examples
Account Management
Messages
Sending Emails
Download Attachments
Mailbox Management
Webhook Settings
Hosted Authentication
Generate URLs for EmailEngine's hosted authentication form. This method calls the EmailEngine API to generate a secure authentication URL with server-side nonce and timestamp for replay attack protection.
Available Parameters
| Parameter | Type | Description |
|---|---|---|
account |
string|null | Account ID (null to auto-generate) |
name |
string | Display name for the account |
email |
string | Email address hint |
redirectUrl |
string | Override default redirect URL |
type |
string | Account type (e.g., 'imap', 'gmail', 'outlook') |
delegated |
bool | Enable delegated access |
syncFrom |
string | ISO 8601 date to sync messages from |
notifyFrom |
string | ISO 8601 date to send notifications from |
subconnections |
array | List of shared mailboxes to connect |
path |
string|array | Mailbox path(s) to monitor |
Webhook Signature Verification
Verify webhook signatures to ensure requests are authentically from EmailEngine. Requires the serviceSecret to be configured.
Outbox Management
System Statistics
Error Handling
The SDK throws specific exceptions for different error types:
Raw API Requests
For endpoints not covered by resource classes:
Testing
Local Testing
Docker Testing
Test across multiple PHP versions using Docker:
Integration Testing
Integration tests run against a real EmailEngine instance:
Note: EmailEngine without a license suspends workers after 15 minutes. Integration tests are designed to complete within this time window. If you need more time, restart EmailEngine:
Manual Integration Testing
To run integration tests against your own EmailEngine instance:
Legacy Compatibility
The SDK maintains backward compatibility with the old API:
License
MIT License - see LICENSE file.
Links
- EmailEngine - Self-hosted email gateway
- EmailEngine Documentation - API reference
- GitHub Repository