A command-line utility for testing email functionality in Joomla sites. This tool sends a test email using your Joomla's configured email settings, allowing administrators to verify that their email configuration is working correctly.
- ✅ Multi-version support: Compatible with Joomla 3.x, 4.x, and 5.x
- ✅ Native integration: Uses Joomla's built-in email configuration
- ✅ Command-line interface: Perfect for automation and server management
- ✅ Customizable content: Set custom email subject and body
- ✅ Zero configuration: Uses your existing Joomla email settings
- ✅ Configuration display: Shows current email transport settings
- ✅ SMTP connectivity test: Verifies SMTP server reachability and handshake before sending
- ✅ Send verification: Detects Joomla 3's
JExceptiontruthy-object trap and PHPMailer silent failures - ✅ Multiple mail methods: Supports SMTP, sendmail, PHPMailer, and all Joomla mail options
- PHP 7.4 or newer
- Joomla 3.0 or newer (tested with Joomla 3.x, 4.x, and 5.x)
- CLI environment (command line access)
- Must be run from Joomla root directory
- Download the script
email-test.php - Upload it to the root directory of your Joomla installation
php email-test.php email-recipient [email-subject] [email-body]| Parameter | Type | Description | Default |
|---|---|---|---|
email-recipient |
Required | Email address to send the test email to | - |
email-subject |
Optional | Custom email subject | "Test email from Joomla" |
email-body |
Optional | Custom email body (plain text) | "This is a test email from Joomla." |
Basic usage:
php email-test.php user@example.orgWith custom subject:
php email-test.php user@example.org "My Test Subject"With custom subject and body:
php email-test.php user@example.org "Server Test" "Testing email functionality from production server."user@server:/var/www/joomla# php email-test.php test@example.com
Detected PHP 8.2.12
Detected Joomla 5.0.3
Email recipient: test@example.com
Email subject: Test email from Joomla
Email body: This is a test email from Joomla.
Email configuration:
Mail online: Yes
Sender name: Site Admin
Sender email: admin@example.com
Mailer: Smtp
SMTP host: mail.example.com
SMTP port: 587
SMTP security: tls
SMTP authentication: Yes
SMTP username: admin@example.com
--- SMTP Connectivity Test ---
Testing connection to mail.example.com:587...
Connection: OK (120 ms)
Handshake: OK (EHLO/HELO accepted)
Server: mail.example.com ESMTP Postfix
--- End SMTP Test ---
--- Sending Email ---
Email sent successfully.
SMTP server accepted the message for delivery.
Check the recipient mailbox for delivery.For comprehensive email testing, we recommend using:
- Mail Tester - Tests spam score and deliverability
- MailHog - Local email testing for development
Example with Mail Tester:
php email-test.php test-abc123@srv1.mail-tester.com "Production Test" "Testing from live server"