#!/usr/bin/perl
# Set Variables
$mailprog = "/usr/lib/sendmail";
# Your Email Address
$youremail = "name\@domain.com";
# Your Name
$yourname = "Hilton";
# Email Address of the recver
$email = "";
# Send file to user in email
open(MAIL, "|$mailprog -f $yourname -t $youremail") or die;
print "|$mailprog -f $yourname -t $youremail\n" ;
# Create headers
print MAIL "From: $yourname\n";
print MAIL "To: $email\n";
print MAIL "Subject: File: $file (uuencoded)\n";
print MAIL "Hi\n,this is Hilton\n";
# File to send to user
$file = "file1";
open(FILE, "uuencode $file $file |") or die;
while( ) { print MAIL; };
close(FILE);
$file="file2";
open(FILE, "uuencode $file $file |") or die;
while( ) { print MAIL; };
close(FILE);
#and finish sending the mail
close(MAIL);
阅读(1901) | 评论(1) | 转发(0) |