how to send email using terminal – CLI mode.
You need to have root access for this ;
# mail -s “test email” [email protected] -c [email protected] -b [email protected]
This would send a blank email with “test email” as its subject. The email would be send to [email protected] with CC to [email protected] and blind CC to [email protected]
# echo “How are you” | mail -s “test email” [email protected] -c [email protected] -b [email protected]
would include “How are you” line as the body message of the email. This could be useful and incorporated from your shell scripts that does a particular function and informs you by email of its function result.
Another way is to
# mutt -s “test email” -a /root/pic.jpg [email protected] -c [email protected] -b [email protected]
would send email with “test emai” as subject name. Email is addressed to [email protected], with CC to [email protected] and BCC to [email protected]. You will noticed the new parameter. This email would attached /root/pic.jpg picture to this email.
Now, piping it like so
# echo “How are you” | mutt -s “test email” -a /root/pic.jpg [email protected] -c [email protected] -b [email protected]
would include “How are you” as body of the email.
# mail -s “test email” [email protected] -c [email protected] -b [email protected]
This would send a blank email with “test email” as its subject. The email would be send to [email protected] with CC to [email protected] and blind CC to [email protected]
# echo “How are you” | mail -s “test email” [email protected] -c [email protected] -b [email protected]
would include “How are you” line as the body message of the email. This could be useful and incorporated from your shell scripts that does a particular function and informs you by email of its function result.
Another way is to
# mutt -s “test email” -a /root/pic.jpg [email protected] -c [email protected] -b [email protected]
would send email with “test emai” as subject name. Email is addressed to [email protected], with CC to [email protected] and BCC to [email protected]. You will noticed the new parameter. This email would attached /root/pic.jpg picture to this email.
Now, piping it like so
# echo “How are you” | mutt -s “test email” -a /root/pic.jpg [email protected] -c [email protected] -b [email protected]
would include “How are you” as body of the email.

