This is the command to send email using mail server with SMTP AUTH.
mail -v -s "Testing SMTP AUTH from mail command" -S smtp-auth=login -S smtp=smtp://mysmtpmailserver.com:587 -S email@example.com -S smtp-auth-user=me -S smtp-auth-password=mypassword firstname.lastname@example.org
-v = verbose
-s = subject
-S = option
For more options and info, please type man mail or info mail.
The last email address is the recipient address.
You can replace mail with mailx.
This command is useful to test your mailserver setup without login to GUI.
Have fun! :)