I store a messages(4 pages in text) in a variabe and
use sendmail to send it. The mail messages get chopped
of but I'm not sure why.
Can you suggest a better way to send a content of a
text file using sendmail. Thanks in advance.

Below is part of my script:

foreach $eachowner(@ownerlist){
      $sql_ownwhat = qq(select sybaseServer, dbName
from DatabaseOwner where email_test = "$eachowner");
     
&sybase_connect("FCCDEV01W",'aigdb',"$sql_ownwhat");
while($ownwhatdata = $sth->fetchrow_hashref){
  `cat
$reportdir/$ownwhatdata->{sybaseServer}..$ownwhatdata->{dbName}.users
>> $reportdir/$eachowner.txt`;
}#end while
 $sth->finish;
 $mail_message = `cat $reportdir/$eachowner.txt`;
 &sendownermail($eachowner,$mail_message);
}#end foreach


sub sendownermail{
my $to        = $_[0];
my $mail_message = $_[1];
open(SENDMAIL, "|/usr/lib/sendmail -oi -t") or die
"Cannot fork for send mail: $! \n";
print SENDMAIL<<"EOF";
From: [EMAIL PROTECTED]
To: $to\@test.com ; ltran\@test.com
Subject: Testing 


$mail_message 
EOF
close(SENDMAIL) or warn "sendmail dinnot close
nicely";
}# end sendownermail

__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to