I'm using the following command to email the content a file from the shell:
mail -s 'Subject' to@domain.ext < file.txt
I always got a plain text mail with empty body and an attachment named "Subject.txt.dat" containing the content of file.txt.
I would like to get a plain text mail with the content of file.txt as body, and no attachments.
All tutorials I've found on Google suggests to use such command but in my case is not working as expected.
I'm on CentOS 6 and
man mail
shows it is using mailx.
This page seems to match your problem and offers some solutions:
https://access.redhat.com/solutions/1136493