Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just want to send a mail automatically on clicking an icon. I want to Attach Ping and Trace Report automatically with time stamp to some of the Email Address with some text in the message body. Is it possible ? I am using thunderbird as my email client with ubuntu 10.10.

share|improve this question
up vote 2 down vote accepted

You could set up the console mailer "postfix".

sudo apt-get install postfix mailutils libsasl2-modules

Depending on what you need and what mail provider you're using, you'll have to do some configuration. The process is described here: . If you happen to speak German there is a more user friendly article:

Then create a shell script from the template:

pingreturn=$(ping -c 1
echo "text in email: $pingreturn" | mail -s "Some Subject"

This will send the mail "text in email: " followed by the return of the ping command to the address "" with the sucject "Some subject".

With a launcher for that script you got your one-click mail. Shoudn't be terribly hard. Might be overkill though.

share|improve this answer

We do this by using a script and mutt (sudo apt-get install mutt) as command line mail client. It is one of few command line mail clients that can use attachments. Plus afaik it does not need any setting up: it uses the currently active mail setup.

As an example you could make a script with a ping and a mail with an attachment and a mailbody(with the same information) like this:

ping -c 4 > {attachment}
ping -c 4 > {/dir/to/mailbody}
mutt {mailadress} -s {subject} -a {attachment} -c {cc} -b {bcc} < {/dir/to/mailbody}

And the launcher, icon or a link or what ever you want this to activate it just needs to launch the script.

share|improve this answer
mutt is a bit bulky and hard to configure. but it can send attachments. If it's enough to just include the ping in the text body, then i'd not use mutt. – con-f-use May 17 '11 at 12:44
@con-f-use he wants tracert too and ping output could be rather long that's why I opted for mutt. But it good to have choices :-) – Rinzwind May 17 '11 at 13:10
I meant no offence. I like mutt too, and your comment for that matter :) – con-f-use May 17 '11 at 14:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.