How to send a graph with a single command from your database to your mail in Unix?
I tried this (gnuplot is available for Solaris, AIX and most Unix derivates) :
echo '
set hea off pages 0 feed off
prom set title "salaries of EMP"
prom unset key
prom unset xtics
prom unset xlabel
prom set term png
prom
prom plot "-" with circle
select row_number() over (order by sal),sal from emp;
prom e
prom quit
' |
sqlplus -s scott/tiger |
gnuplot |
uuencode emp.png |
mailx [email protected]
The picture is sent as attachment.
If you want to embed your png in an HTML mail, use sendmail
/usr/sbin/sendmail -t <