Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mail List 1

Status
Not open for further replies.

masalachol

Technical User
Apr 8, 2004
20
US
hello:

I am in a UNIX environment and I have a file named "mailout" that I am reading with the program below.What I really want to do is mail the report to my email address without echoing it to my screen.

Looking forward to your replies.


#--------------------------------------------------------
# VARIABLES #
#--------------------------------------------------------

$file="/some/directory/where/file/found/mailout";
$date=`date`;

#--------------------------------------------------------
# PROGRAM #
#--------------------------------------------------------

open (FA, $file);
while (<FA>){
split (/\|/);
$vname = $_[7] ;
$vlist{$vname} +=1 ;
}
print "$date\n";
foreach $vname (sort (keys %vlist)) {
print ("$vname: $vlist{$vname}\n");
}
open MAIL, "|mail myemailaddress";{
print MAIL "";
close MAIL;
 
very simply:-

Code:
undef $/;

$file = "ftp.pl";
open (INFILE, "< $file");
$content = <INFILE>;
close INFILE;

open (MAIL, '| /usr/sbin/sendmail -t');
print MAIL "To: [red]you\@yourisp.com[/red]\n";
print MAIL "Subject: $file\n";
print MAIL "$content\n";
close MAIL;


Kind Regards
Duncan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top