Script for cron

Dear All,

I have an assignment about collecting /var/adm/messages on each server running Solaris 9. All these servers will be installed with a script that collect all the messages in cron. All the messages will be collected by a single server.
I have a script to collect all the messages, but instead of send it to another server, the script will send all the messages through the mail service. I'm thinking about using ftp.. But, how to write it on the script?

Thx

Please try using the below mentioned script used for sending the mails from system.

to="mail id"
HOSTNAME=`uname -n`
MAILFILE=/tmp/mail.txt
mail_generate() 
{
echo "
ehlo $HOSTNAME
mail from:<MailID>" > $MAILFILE
for tolist in $to
do
echo "rcpt to:$tolist" >> $MAILFILE
done
echo "
data
Date:
From: FROM MAIL ID
Subject: $SUBJECT
To:$to
Cc:
Content-Type: text
All,
  Below are the contents of message file
"  >> $MAILFILE
cat /var/adm/messages >> $MAILFILE
echo "

Regards
$HOSTNAME .
.
quit " >>  $MAILFILE

cat  $MAILFILE |telnet MAILSERVER 25 1> /dev/null 2>&1
$RM $MAILFILE
}
mail_generate

i'll try it..
Thx