Chinaunix首页 | 论坛 | 博客
  • 博客访问: 296555
  • 博文数量: 56
  • 博客积分: 3056
  • 博客等级: 中校
  • 技术积分: 662
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 12:37
个人简介

一不小心出了国

文章分类

全部博文(56)

文章存档

2015年(1)

2011年(1)

2010年(1)

2009年(5)

2008年(14)

2007年(34)

我的朋友

分类:

2007-07-17 11:55:55

#!/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);
阅读(1877) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2008-03-19 17:22:23

回去好好看看perl语法吧