Replace WordPress's default email sending with the Enginemailer REST API for improved deliverability and reliability.
Latest Release (v0.2.5): WordPress 7.0 compatibility release that restores legacy EngineMail upgrade paths, hardens test-email validation, and aligns the WordPress test stack. Release Notes | Download
Important: This plugin is an independent WordPress integration and is not affiliated with or endorsed by Enginemailer.
- EnjinMel SMTP - The name of this WordPress plugin
- Enginemailer - The third-party email delivery API service (https://enginemailer.com)
This plugin connects your WordPress site to the Enginemailer service API.
- Seamless Integration - Automatically intercepts all
wp_mail()calls - Enhanced Deliverability - Routes emails through Enginemailer's reliable infrastructure
- Comprehensive Logging - Track all email sends with timestamps, recipients, and status
- Test Email Functionality - Verify configuration by sending test emails
- Secure Storage - API keys encrypted using AES-256-CBC encryption
- Log Management - Automatic log retention with configurable cleanup schedules
- Admin Interface - User-friendly settings page with advanced log viewer
- Export Capability - Export logs to CSV for analysis
- Security First - Nonce verification, input sanitization, output escaping throughout
- WordPress: 5.3 or higher
- PHP: 7.4 or higher
- Enginemailer API Key: Available at https://portal.enginemailer.com/Account/APIs
- Download the latest release from the plugin repository
- Navigate to Plugins → Add New → Upload Plugin
- Choose the downloaded ZIP file and click Install Now
- Click Activate Plugin
- Go to EnjinMel SMTP → Settings to configure your API key
- Upload the
enjinmel-smtpfolder to/wp-content/plugins/ - Activate the plugin through the Plugins menu in WordPress
- Configure the plugin via EnjinMel SMTP → Settings
- Navigate to EnjinMel SMTP → Settings
- Enter your Enginemailer API Key
- Set your default From Name and From Email
- Click Save Changes
- Use the Send Test Email feature to verify everything works
For enhanced security in shared hosting or high-security environments, add these constants to your wp-config.php:
// Custom encryption keys (recommended for production)
define('ENJINMEL_SMTP_KEY', 'your-32-character-encryption-key');
define('ENJINMEL_SMTP_IV', 'your-16-character-iv');Generate secure keys using:
// Generate encryption key
echo bin2hex(random_bytes(16)); // 32 characters
// Generate IV
echo bin2hex(random_bytes(8)); // 16 charactersIf these constants are not defined, the plugin will auto-generate and store encryption keys in the database.
- API Key - Your Enginemailer API key (encrypted before storage)
- Sender Name - Default sender name for outgoing emails
- Sender Email - Default sender email address
- Template ID - Optional Enginemailer template ID
- Campaign Name - Optional campaign identifier for tracking
- Force Sender - Override sender details set by other plugins
- Enable Logging - Toggle email logging (enabled by default)
Once configured, the plugin automatically handles all WordPress emails. No code changes needed!
// Standard wp_mail() - automatically uses EnjinMel SMTP
wp_mail(
'recipient@example.com',
'Subject Line',
'Email message content',
['Content-Type: text/html; charset=UTF-8']
);
// With attachments
wp_mail(
'recipient@example.com',
'Subject with Attachment',
'Message content',
[],
['/path/to/attachment.pdf']
);The plugin provides numerous hooks for customization:
// Modify API payload before sending
add_filter('enjinmel_smtp_payload', function($payload, $normalized, $settings) {
$payload['CustomField'] = 'value';
return $payload;
}, 10, 3);
// Modify request timeout (default: 15 seconds)
add_filter('enjinmel_smtp_request_timeout', function($timeout) {
return 30;
});
// Modify log retention (default: 90 days)
add_filter('enjinmel_smtp_retention_days', function($days) {
return 30;
});
// Before email send
add_action('enjinmel_smtp_before_send', function($normalized, $payload) {
// Custom logic before API call
}, 10, 2);
// After email send
add_action('enjinmel_smtp_after_send', function($normalized, $payload, $result) {
// Custom logic after API call
}, 10, 3);Access comprehensive email logs at EnjinMel SMTP → Email Logs:
- Filter by status (sent/failed)
- Search by recipient or subject
- Date range filtering
- Export to CSV
- Bulk delete operations
- Pagination with configurable items per page
# Clone the repository
git clone <repository-url>
cd enjinmel-smtp
# Install dependencies
composer install
# Start WordPress environment (requires @wordpress/env)
npx wp-env start# Run PHPUnit tests
vendor/bin/phpunit
# Using wp-env (if configured)
npx wp-env run tests-cli phpunit
# Check code standards
vendor/bin/phpcs
# Fix code standards automatically
vendor/bin/phpcbf# Create new feature branch with spec
bash scripts/create-new-feature.sh "feature description"
# Get active feature paths
bash scripts/get-feature-paths.sh
# Build a lean distribution zip (excludes tests/docs/dev files)
mkdir -p dist
git archive --format=zip --output dist/enjinmel-smtp.zip --worktree-attributes HEAD- Follows WordPress Coding Standards
- PHP 7.4+ compatibility
- PSR-4 autoloading (via Composer)
- Comprehensive PHPDoc comments
- Security-first approach
- Encrypted Storage - API keys encrypted with AES-256-CBC
- Nonce Protection - All admin actions verified with WordPress nonces
- Capability Checks -
manage_optionscapability required for all admin functions - Input Sanitization - All user inputs sanitized before processing
- Output Escaping - All outputs escaped to prevent XSS
- Prepared Statements - All database queries use
$wpdb->prepare() - Mail Block Preservation - Existing
pre_wp_mailblockers, includingWP_Error, are preserved - CSV Export Hardening - Log exports neutralize spreadsheet formula prefixes
If you discover a security vulnerability, please report it via GitHub Security Advisories or create a private issue. Do not create a public issue for security vulnerabilities.
Works seamlessly with any plugin using wp_mail():
- ✅ WooCommerce
- ✅ Contact Form 7
- ✅ Gravity Forms
- ✅ Easy Digital Downloads
- ✅ MemberPress
- ✅ BuddyPress
- ✅ bbPress
Upon deactivation:
- Cron jobs are automatically cleared
- Settings remain in database
Upon deletion:
- Plugin settings are removed
- Encryption keys are deleted
- Scheduled events are cleared
- Logs are preserved by default
To delete logs on uninstall, add to wp-config.php:
define('ENJINMEL_SMTP_PURGE_LOGS_ON_UNINSTALL', true);See CHANGELOG.md for detailed version history.
WordPress 7.0 compatibility and maintenance
- Fixed: Restored legacy EngineMail compatibility helpers for settings, log migration, cron cleanup, and mail failure metadata.
- Fixed: Hardened Send Test Email recipient validation to reject tampered input.
- Fixed: Made log-table detection work with persistent WordPress tables and temporary PHPUnit tables.
- Changed: Verified compatibility with WordPress 7.0 and aligned the test stack with PHPUnit 9.6 /
wp-phpunit7.0. - Changed: Removed the plugin bootstrap from Composer
autoload.filesso Composer dev tools run outside WordPress.
Security fixes and hardening
- Fixed: Preserve prior non-null
pre_wp_mailreturn values, includingWP_Error, before sending through EnjinMel. - Fixed: Neutralize spreadsheet formula prefixes in exported email log CSV values.
- Hardened: Insert dynamic Send Test Email failure messages as text instead of HTML.
- Tests: Added regression coverage for prior
WP_Errorpreservation and CSV formula neutralization.
Previous Releases:
- v0.2.3 - Plugin-check and packaging hygiene
- v0.2.2 - Critical bug fixes and API V2 compliance
- v0.2.0 - Major security and performance update
- v0.1.0 - Initial release with Enginemailer REST API integration
For support, documentation, issues, and feature requests, please refer to the project repository.
Contributions are welcome!
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Run tests:
composer test - Check code standards:
./vendor/bin/phpcs - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the GNU General Public License v2.0 or later - see the LICENSE.txt file for details.
- Author: Liew CheonFong
- License: GPLv2 or later
- Built for the WordPress community
- Integrates with Enginemailer email service
Made for WordPress