Search code examples
linuxemailunixmailx

mailx function is not working


I am trying to use mailx function to send an e-mail to my personal email address.But I never received an email.Can someone help me pls. Here is my command below.

PRI_EMAIL_SUBJECT="Some Blah Blah"
PRI_EMAIL_ADDRESS="[email protected]"
PRI_EMAIL_BODY="$PRI_SETS_RAN_SUCSFL_CNT no. of sets ran successfully."

echo "Sending e-mail"
mailx -s $PRI_EMAIL_SUBJECT $PRI_EMAIL_ADDRESS < $PRI_EMAIL_BODY
echo

Solution

  • This perfectly works.

     echo "something" | mailx -v -s "subject" [email protected]