Welcome to EmailEngine
EmailEngine is a self-hosted email gateway that provides a unified REST API for accessing email accounts through IMAP, SMTP, Gmail API, and Microsoft Graph API. Build email functionality into your application without dealing with the complexity of different email protocols and providers.
What Can You Do With EmailEngine?
Send Emails
Send emails through any email provider with a single API endpoint. EmailEngine handles SMTP connections, OAuth2 authentication, retries, and delivery tracking.
// Send an email with one API call
POST /v1/account/{account}/submit
{
"to": [{"address": "user@example.com"}],
"subject": "Hello from EmailEngine",
"html": "<p>Your message here</p>"
}
Receive Emails in Real-Time
Get instant webhook notifications when new emails arrive, no polling required.
// Webhook payload for new email
{
"event": "messageNew",
"data": {
"id": "AAAAAQAACnA",
"subject": "Re: Meeting tomorrow",
"from": {"address": "client@example.com"},
"text": {"plain": "Thanks for scheduling..."}
}
}
Manage Email Accounts
Register and manage multiple email accounts with automatic connection handling.
// Register an email account with OAuth2
POST /v1/account
{
"account": "user123",
"email": "user@gmail.com",
"oauth2": {
"provider": "AAABlf_0iLgAAAAQ", // OAuth2 app ID from EmailEngine (base64url encoded)
"refreshToken": "1//0gF...", // Refresh token from OAuth2 flow
"auth": {
"user": "user@gmail.com" // Email address (required)
}
}
}
Search and Organize
Search messages, organize mailboxes, manage flags, and download attachments.
Why EmailEngine?
One API for All Providers
- IMAP/SMTP - Works with any email provider
- Gmail API - Native Gmail integration with Cloud Pub/Sub
- Microsoft Graph API - Native Microsoft 365 and Outlook integration
- Consistent interface across all provider types
Built for SaaS Applications
- Multi-account - Manage thousands of email accounts
- OAuth2 support - Built-in OAuth2 for Gmail, Google Workspace, Microsoft 365
- Webhooks - Real-time notifications for all email events
- Queue management - Automatic retries and delivery tracking
Production-Ready
- Self-hosted - Full control over your data and privacy
- Scalable - Vertical scaling with performance tuning
- Reliable - Automatic reconnection and error recovery
- Performant - Efficient connection pooling and caching
Quick Start
Get your first email working in 10 minutes:
- Install EmailEngine - Set up with Docker, npm, or on platforms like Render.com
- Add Your First Account - Register an email account via API
- Send an Email - Submit your first message
- Receive Webhooks - Get notified of new emails
Common Use Cases
Email-Integrated SaaS
Build email functionality into your SaaS application:
- Send transactional emails from user accounts
- Receive and process incoming emails
- Integrate customer email into your CRM
- Read the CRM integration guide →
Email Automation
Automate email workflows:
- Auto-respond to incoming emails
- Forward emails based on rules
- Track email threads and replies
- Learn about email threading →
Customer Support
Integrate email into your support system:
- Manage multiple support email accounts
- Track email conversations
- Send templated responses
- Explore mail merge →
Email Analytics
Analyze email communications:
- Track email delivery and opens
- Generate AI-powered email summaries
- Monitor email activity across accounts
- See AI integration →
Architecture Overview
EmailEngine works as a middleware between your application and email providers:
How it works:
- Your Application - Makes REST API calls to EmailEngine and receives webhook notifications
- EmailEngine - Maintains persistent connections to email providers and manages data synchronization
- Redis - Stores email metadata, message queues, and account data for fast access
- Email Providers - Gmail, Outlook, Microsoft 365, and any IMAP/SMTP server
Data flows:
- API requests: Your app calls EmailEngine REST API → EmailEngine connects to email providers or retrieves from Redis
- Webhooks: Email providers send updates → EmailEngine processes → Your app receives webhook notifications
- Data storage: EmailEngine stores metadata and queues in Redis (email content is not stored, only fetched on demand)
Key features:
- Unified API for all email providers (IMAP, SMTP, Gmail API, Microsoft Graph API)
- OAuth2 authentication support for Gmail, Google Workspace, and Microsoft 365
- Real-time webhooks for instant email notifications
- Automatic reconnection and error recovery
- Queue management with automatic retries
API Reference
EmailEngine provides a comprehensive REST API:
- API Overview - Authentication, conventions, error handling
- Account Management - Register and manage accounts
- Sending Emails - Submit endpoint and options
- Message Operations - List, search, and manage emails
- Complete API Docs - All 72 endpoints with schemas
Get Help
- Troubleshooting Guide - Common issues and solutions
- GitHub Issues - Report bugs and request features
- Support - Get professional support
System Requirements
- Node.js 20.x or higher
- Redis Any version (or Redis-compatible service like Upstash)
- Memory Minimum 2GB RAM (4GB+ recommended for production)
- OS Linux, macOS, or Windows
License
EmailEngine requires a license key for production use. Get a license:
- 14-Day Free Trial - Full features, no credit card required
- Production License - For commercial use
Next Steps
New to EmailEngine?
- Read the introduction to understand what EmailEngine can do
- Follow the quick start guide to get your first email working
- Set up OAuth2 for Gmail or Outlook
Ready to build?
- Explore the API reference to see all available endpoints
- Check out integration examples for PHP, CRM, AI, and more
- Read about performance tuning for production deployments
Need inspiration?
- See the CRM integration guide for a complete architecture example
- Explore AI integration for email summarization and automation
- Compare EmailEngine vs Nylas to understand the differences