Sending E-MAIL with the attachment by single command usin mail utility

Posted on 2004-10-25
Medium Priority
Last Modified: 2010-04-21
Could anyone share the working example of
how to send e-mail with the attachment in Linix environment,
let's say I have to send e-mail by single command executed as part of the bash shell script.

Thanks all.
Question by:vitali
LVL 12

Accepted Solution

stefan73 earned 252 total points
ID: 12401372
Hi vitali,
You can use mailx and uuencode:

uuencode < file file | mailx -s subject someone@somewhere.org

...not pretty, but it works.


LVL 11

Assisted Solution

avizit earned 248 total points
ID: 12402719

Expert Comment

ID: 12425666
echo 'message' | mutt -a file -s 'subject' recipient

To send a MIME encoded attachment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
The video provides a quick and easy steps to migrate MBOX file to well known Outlook PST and Office 365. Besides this, it also supports and migrates more than 20 email clients of MBOX which include AppleMail, Opera, Thunderbird and SeaMonkey effortl…
Free Data Recovery software is an advanced solution from Kernel Tools to recover data and files such as documents, emails, database, media and pictures, etc. It supports recovery from physical & logical drive after a hard disk crash, accidental/inte…
Suggested Courses

593 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question