How send email from command line specifying the email subject and using postfix?

5,095

Take a look at mailx:

echo "hello world" | mailx -s "Test from CLI" [email protected]
Share:
5,095
Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin over 1 year

    I installed Postfix, and get the /usr/lib/sendmail binary. What I want is send an email alo

    /usr/bin/printf "%b" "EMAIL_BODY" | /usr/lib/sendmail -s "EMAIL_SUBJECT" [email protected]
    

    But the -s option is not recognized. How send email from command line specifying the email subject and using postfix?

  • Admin
    Admin over 10 years
    Thanks a lot for your help, ones of the Ubuntu packages to get a mailx command working is: bsd-mailx