At Fri, 15 Jan 2010 15:15:48 +0200 CentOS mailing list <centos@centos.org> 
wrote:

> 
> Hi all,
> 
> i'm trying to get a script to send me an email whenever a certain 
> condition takes place..
> i'm afraid i dont have experience with mail command nor anything else 
> related to sending emails for that matter..
> 
> i googled a bit and tried using mutt and mail ...
> though i do not recieve any email in my inbox...
> 
> the command im using is the following : mail -s "disk space report" 
> r_o_l_a_...@hotmail.com
> 
> should i setup a default smtp to use? where can i check for the errors 
> that are taking place?


If it is a default CentOS install, you should have sendmail installed,
but you probably need to install sendmail-cf and create a site specific
sendmail.cf file (from a site specific sendmail.mc file).

Look in /var/log/maillog for error messages.

The 'mail' command is the correct thing to use, except you need to bind
stdin to something. Eg:

df -h | mail -s "Disk space report" mum...@whatever.com

or

mail -s "Disk space alert!" mum...@whatever.com </dev/null

> _______________________________________________
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
> 
>                                                                               
>                        
> 

-- 
Robert Heller             -- 978-544-6933
Deepwoods Software        -- Download the Model Railroad System
http://www.deepsoft.com/  -- Binaries for Linux and MS-Windows
hel...@deepsoft.com       -- http://www.deepsoft.com/ModelRailroadSystem/
                                                          
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Reply via email to