Thursday, November 15, 2007

Sending email attachments from linux command line

Several times we need to send mail attachments from command line, when administering a server remotely. The procedure is simple using mutt that is available in all Unix flavors and Windows Microsoft.

$ mutt -s "Important Logs" -a http_access.log walter@nospam.com

Or Without subject:

$ echo | mutt -a [file] [mail@address.com]

Mutt website: http://www.mutt.org/.

1 comentarios:

Anonymous said...

If you are having trouble with mutt trying to be interactive, make sure stdin isn't a tty (e.g., redirect stdin from /dev/null, or "echo | mutt ...".