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 [email protected] "Test email" "This is a test email"
user@server:/var/www/web# php email-test.php [email protected]
Detected PHP 8.2.12
Detected Joomla 3.10.12
Email recipient: [email protected]
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/