Operating System - Linux
1752571 Members
5192 Online
108788 Solutions
New Discussion юеВ

how to send email from cron

 
SOLVED
Go to solution
Maaz
Valued Contributor

how to send email from cron

I wana send an email with attachment to root on regular basis, but following cron job never runs, plz help

57 15 * * * (echo "Subject: Quota Report";echo;echo)|/usr/bin/mail root -a "/quotareport.txt"



3 REPLIES 3
Ivan Ferreira
Honored Contributor
Solution

Re: how to send email from cron

Use the following command:

mail -s "Quota Report" root < /quotareport.txt
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Maaz
Valued Contributor

Re: how to send email from cron

since I wana send the file as an attachment, I use the command in cron

57 15 /usr/bin/mail -s "Quota Report" -a /quotareport.txt root

DONE :)
Thanks n Regards
skt_skt
Honored Contributor

Re: how to send email from cron

echo "Console IP NOT available now for ${i}" |sendmail t.kumar@xxx.com


using sendmail