Putting subject & from in mail from command line

I couldn’t figure out how to send an email with both the subject and from set from the command line.

  1. mail -s "my subject" example@foo.bar

worked with mail but would only set the subject.

  1. sendmail -f "sender@foo.bar" receiver@foo.bar

worked with sendmail but would only set the “from”. With a little help from Google I put this together:
Continue reading