Sending e-mail via command line
There are multiple commands that allow us to send emails using the command line. The traditional way this has been done, usually to check if a mail server is working properly has been to establish a connection via telnet and send the raw SMTP commands.
On the other hand, as we have mentioned, we can use specific command line commands and programs that serve this purpose.
ssmtp
In this case we use a text file containing the raw SMTP commands that we already use with telnet, and also the content of the mail itself.
sendmail
And if we use the text file from the previous example
curl
swaks
mutt
mailx
openssl
A mail.txt file can have the following content:
Of course these are only examples and the parameters must be adapted to individual needs.