0

I tried a couple of methods to send a report mail from my shell script. It either gives me an error or I do not get any mail. Please find it below.

echo "My Mail" | mail -s "My Subject" [email protected]

Following gives me the error:

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

and if I use the below command

echo "My Mail" | mailx -s "My Subject" [email protected]

It does not give me any error, but I would not receive any mail at [email protected](or any other mail ID)

Would anyone help me out here??

3
  • Edit: Masked your email id. Please avoid putting your real email address/information in future. Commented Sep 21, 2016 at 5:15
  • Have you configured your smtp? mailq? Commented Sep 21, 2016 at 6:58
  • Have you checked this? Commented Sep 21, 2016 at 12:15

0

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.