Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to send mail with attachment  RSS feed

 
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
 
Saloon Keeper
Posts: 19271
85
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.
 
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: 19271
85
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!