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" abc@gmail.com -- -f abcd@gmail.com < BodyofTheMail.txt 

its sending attachment with subject without body of the mail

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
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 mailbox@example.com < /path/to/messagebody.txt
DopeGhoti
  • 76,081