2

I am using below code to send mail using ksh script in unix

echo "Hi. here is my message body" | mail -s "test mail ksh" "[email protected],[email protected]"

But i keep getting the below error

    mail: illegal option -- s
    usage: mail [+] [-epqr] [-f file]
    mail [-dt] persons

Please help with the correct format to use.

1 Answer 1

0

Some mail(1) implementation has no -s subject option. Use mailx(1) instead if available. Or use sendmail(1) or other mailers with suitable options and input for it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.