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

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
Himavanth
  • 21
  • 1
  • 1
  • 2

1 Answers1

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
DopeGhoti
  • 73,792
  • 8
  • 97
  • 133