0

I am trying to sending mail with attachment using shell script, but I am not getting mail.

Shell Script

 #!/bin/bash

 $ echo "Mail Sent" | mail -s "a subject" -a "Report_by_Customer_20190614_131246.xls" test@gmail.com
fahime
  • 179
  • 2
  • 12
Tanu
  • 1
  • 2
  • not getting message at all, or not getting the attachment? `-a ...` is not the right way to attach files – jhnc Jun 14 '19 at 17:24

1 Answers1

0

Use mutt. Add list of files that you want to attach

echo "body" | mutt -s "subject" -a attachment0 attachment1 [...] -- test@gmail.com

Also here you can find another options

vik_78
  • 1,107
  • 2
  • 13
  • 20