1

Can you please tell me how to send the attachment, subject and body of the mail using mailx command.

I am using

uuencode travel$datestamp.XLS Travel$datestamp.XLS | mail -s "International Savers Tracking" [email protected] -- -f [email protected] < BodyofTheMail.txt 

its sending attachment with subject without body of the mail

1 Answer 1

3

You're both piping into and indirecting into mail; you can only have one standard input. Also, uuencode isn't needed. Try:

mail -s "Subject" -a /path/to/attachments/file.ext [email protected] < /path/to/messagebody.txt
1
  • This worked for me too. Thank you. Commented Jun 25, 2019 at 21:36

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.