1. Using ‘sendmail’ Command
Sendmail is a most popular SMTP server used in most of Linux/Unix distribution. Sendmail allows sending email from command line. Use below instructions to send email using ‘sendmail‘ command. Create a file using following content.
[root@tecadmin ~]# nano /tmp/email.txt Subject: Terminal Email Send Email Content line 1 Email Content line 2
Subject: line will be used as subject for email. Now send email using the following command.
[root@tecadmin ~]# sendmail email@example.com < /tmp/email.txt
2. Using ‘mail’ Command
mail command is most popular command to send emails from Linux terminal. Use few of below examples to send an email.
If mail command is not installed, you can install it by:
(for Debian/Ubuntu System) or
apt-get install mail-utils
(for Redhat based system) Continue reading “Send Email from Linux Terminal” »