0

I use the below command to attach a file.

mailx -s "Report 05/06/07" add@dom.com < /test_output/report.html

uuencode /test_output/report.html /test_output/report.html | mail -s "mailing my c file" add@dom.com

but the attachment is not attached with mail. The attachment content is shown in the mail body.

How i can solve this or is there any other way to send mail automatically with the attachment?

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
noor
  • 2,954
  • 2
  • 16
  • 29
  • 1
    Embedding a binary into the body of the email does not make it an attachment. For that, you want to use MIME encoding. It's an established mechanism, two decades old, and is explained fairly well all over the Internet (a quick search with your favourite search engine will net many results). There's even [a super simple example](https://en.wikipedia.org/wiki/MIME#Multipart_messages) on Wikipedia. For easy handling of attachments from the command line, consider switching from mail/mailx to [mutt](http://www.mutt.org/), which is available in OSX via macports, fink, brew, etc. – ghoti Jun 22 '16 at 14:33
  • thanks @ghoti i will follow your instruction. – noor Jun 22 '16 at 14:39

0 Answers0