I'm using Amazon Linux. I found the following for sending the contents of a file as an attachment
cat /tmp/output.txt | mailx -s "Subject" "myaddress@gmail.com"
But what I want to do is send the contents of the file as the body of the email, as opposed to an attachment. How do I do this?
You man use "lower level" sendmail
program.
#!/bin/sh
# cat - ... <<END - cat reads "here document" via its stdin
# empty line after email headers IS REQUIRED
cat - /tmp/output.txt <<END | /usr/sbin/sendmail -- myaddress@gmail.com
Subject: Subject
To: myaddress@gmail.com
END