• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to send mail with attachment  RSS feed

 
Suhas Madap
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Please some one help is writing a shell script, which will send a file as an attachment in the mail?

Thanks in advance
 
Tim Holloway
Saloon Keeper
Posts: 18789
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "mail" command doesn't handle attachments, but "mutt" is popular for that purpose. We used to attach PDFs.
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Found somewhere else - not tested myself:
 
Tim Holloway
Saloon Keeper
Posts: 18789
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That looks like a solution I've seen before. "mailx" is an alias for the "mail" command.

I think mutt's supposed to have a less complex invocation, but mailx is more likely to be found on most machines.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!