How can I send an email from the command line?
Eric L. Howard
elh at outreachnetworks.com
Sat Feb 12 21:01:53 UTC 2005
At a certain time, now past [Feb.12.2005-10:39:19AM +0000], neil at neilwoolford.co.uk spake thusly:
> Hi all,
>
> I'd like to semi-automatically send a short email of system information
> from my brother's computer to mine. The nearer I can get to a 'one
> click' process the better.
>
> Evolution works fine on my brother's machine, and he knows how to use
> the basic mail features. So if I could get a script to start evolution
> and fill in a message, he could easily send it to me. Frustratingly,
> while I can find how to initiate a message from the command line
> ("evolution mailto:joe at soap.com"), I can't find out how to insert text
> into the message from the command line. This must be possible, as Gnome
> does it when sending an invitation to a VNC session. I can't find any
> proper man pages about using Evolution from the command line, so I'm
> stuck.
>
> Any suggestions?
The text-based mail client 'mutt' is installed by default on Ubuntu. It's
extremely powerful [I've used it on every system I've owned since 97] and
can be used in scripts, command pipes, etc.
The syntax for CLI or script use would be something like:
mutt -s "$SUBJECT_HERE" -x $TO_ADDRESS
You can use that after the piped output of a command:
cat $YOUR_FILE | mutt -s "$SUBJECT_HERE" -x $TO_ADDRESS
Take a look at the '-a' flag to mutt if you want to attach files instead of
taking piped output as your message.
~elh
--
Eric L. Howard e l h @ o u t r e a c h n e t w o r k s . c o m
------------------------------------------------------------------------
www.OutreachNetworks.com 313.297.9900
------------------------------------------------------------------------
JabberID: elh at jabber.org Advocate of the Theocratic Rule
More information about the ubuntu-users
mailing list