I am trying to automate my email by using this command on unix VI:
echo 'Message body goes here' | mail -s 'subject line goes here' firstname.lastname@example.org
mailx is usually link with mail.
Try passing the options to sendmail by putting double-dash at the end and then specifying -f (from) or -r (return):
mailx .... -- -r email@example.com mailx .... -- -f firstname.lastname@example.org
You could also try "-a" option as mentioned here
mailx -a 'From:email@example.com' ...
If you want to try the sendmail:
sendmail -t <<EOF To: firstname.lastname@example.org Subject: Hi From: email@example.com Reply-To: firstname.lastname@example.org Hello EOF