send email from command line

Erik Christiansen dvalin at internode.on.net
Tue Sep 23 10:14:51 UTC 2008


On Tue, Sep 23, 2008 at 11:05:43AM +0200, mierda tuti wrote:
> I would like to can send mail from command line with mailx but I don't have
> idea.

Does it not work when you just type "mail mierda", then <enter>?
(Assuming you are "mierda" on your ubuntu box.) After that, everything
is pretty obvious, so long as you realise that after filling in the text
for "Subject:", you're onto the message body, which in turn is
terminated with a Control-D.

You can also use it to send mails from scripts, e.g:

echo "They all had spots" | mail -s "Myscript had kittens" erik

> Could you say me how to configure?

It normally works without configuration. (Has done so for me for several
decades, on HP-UX, Solaris, and Linux.)

You may find useful details at
http://www.gnu.org/software/mailutils/manual/index.html

Erik




More information about the ubuntu-users mailing list