Forum archive
How to send mail from command line (bash script)?
I want cron to send me an email every day by SMTP, so I tried to use the "mail -s" command (postfix is installed and working, as this is the TKL bugzilla appliance). But the command is not found. What is the "TKL way" to send a email from the command line (bash script)?
And, is there a way to tell cron that errors shall not go to /var/mail/root but actually are forwarded to an external address using SMTP?
If you keep in mind that TKL is based on Ubuntu 10.04/Lucid (most parts are binary identical, just with added software not from repos and some additional tweaking and preconfig etc) that should get you going. The Ubuntu Server Guide can be pretty handy. To be honest though I had a quick look and dspite the fact that I fond lots of info about install and config, I found basically none on stand alone usage...
So I had a quick search of the Ubuntu forums and still got nowhere... Even a general google didn't give me any clarity... some stuff said to use "mail" and some other stuff said to use "sendmail" but I wasn't completely sure I was getting the full picture...
Sorry I couldn't help more. Be great to hear back when you work it out as no doubt others will run up against this in the future...