Trying to email text, getting blank email

Hello, and thank you for help in advance, i seem to have this script working, except for the email part, it sends me a blank email, am i not redirecting the output of my text file the right way?

#!/usr/bin/ksh

rm installed_zones.txt

installed=/home/xxx/stuff/installed_zones.txt

for EACH in `cat serverlist.txt`
do
ssh $EACH zoneadm list -ipc | grep running | grep -v "global" >> installed_zones.txt
done

if [ -s installed_zones.txt ] ; then
cat /home/xxx/stuff/installed_zones.txt | mail xxx@xxx.com
               exit
else
echo NO INSTALLED ZONES  | mail xxx@xxx.com
               exit
fi

Maybe just -s "subject..." missing ?

for EACH in `cat serverlist.txt`
do
ssh $EACH zoneadm list -ipc | grep running | grep -v "global" >> installed_zones.txt
done

Useless use of cat, dangerous use of backticks. You don't need to run grep 18,000 times for 9,000 hosts either. This would be faster and more reliable:

while read EACH
do
        ssh "$EACH" zoneadm list -ipc
done < serverlist.txt | grep running | grep -v "global" > installed_zones.txt
cat /home/galanteb/stuff/installed_zones.txt | mail xxx@xxx.com

Another useless use of cat, though probably not as big a deal. Redirect in a file with < instead. Also, as vbe says, try giving it a subject.

mail xxx@xxx.com -s "subject" < /home/galanteb/stuff/installed_zones.txt

i could not get "mail" to work, this is solaris 10. this below finally worked. I appreciate your help!

/usr/ucb/mail -s "ZONES INSTALLED BUT NOT RUNNING" me@x.com < installed_zones.txt