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" "[email protected]"
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 -- [email protected]
Subject: Subject
To: [email protected]
END