If you need to sent a test email from a server via command line, you can use the following.
This one uses PHP to send the email. Simply replace test@somedomain.test with your own email address.
php -r “mail(‘test@somedomain.test’, ‘test’, ‘test’);”
To send mail directly to the mail queue without the use of PHP, use the following.
mail -v test@somedomain.test
It will then ask you to supply a subject. Just type in test and press enter. It will then take you to a blank line. You can either put a message, then on a blank line put a single period “.” to send the email, or if you don’t need to put a message, just put a period, and press enter.
