This is a simple script to test the email sending functionality of Joomla. It allows sending an email to a specific address with a specific subject and body. This helps to confirm that the email settings are correct and the emails are sent correctly. The script supports all available Joomla mail configuration options, including SMTP and PHPMailer.
- Download the script
email-test.php
- Upload it to the root of your Joomla installation
- Run the script from console (SSH)
Script accepts 3 parameters:
- Email address of recipient (required)
- Email subject (optional)
- Email body (optional)
php email-test.php user@example.org "Test email" "This is a test email"
user@server:/var/www/web# php email-test.php test-prdnmijk9@srv1.mail-tester.com
Detected PHP 8.2.12
Detected Joomla 3.10.12
Email recipient: test-prdnmijk9@srv1.mail-tester.com
Email subject: Test email from Joomla
Email body: This is a test email from Joomla.
Email sent. Check the mailbox.
- The recommended service to test the mail settings is: https://www.mail-tester.com/