perl 发送短信
来源:互联网 发布:网络捕鱼游戏大厅 编辑:程序博客网 时间:2024/06/06 01:12
<pre name="code" class="sql">#!/usr/bin/perl use Net::SMTP; use HTTP::Date qw(time2iso str2time time2iso time2isoz); # mail_user should be your_mail@163.comsub send_mail{ if ( $#ARGV < 0 ){ print "please input your database name!\n"; exit(-1); } my $db_name= $ARGV[0];my $CurrTime = time2iso(time()); my $to_address = shift; my $mail_user = 'zhao.yangjian@163.com'; my $mail_pwd = 'xxxxxxx'; my $mail_server = 'smtp.163.com'; my $from = "From: $mail_user\n"; my $subject = "Subject: zjcap info\n"; my $info = "$CurrTime--mysql-$db_name is backup done"; my $message = <<CONTENT; $infoCONTENT my $smtp = Net::SMTP->new($mail_server); $smtp->auth($mail_user, $mail_pwd) || die "Auth Error! $!"; $smtp->mail($mail_user); $smtp->to($to_address); $smtp->data(); # begin the data $smtp->datasend($from); # set user $smtp->datasend($subject); # set subject $smtp->datasend("\n\n"); $smtp->datasend("$message\n"); # set content $smtp->dataend(); $smtp->quit();};@arr_mail=( 'zhaoyangjian@zjcap.cn','267020090@qq.com');foreach (@arr_mail){send_mail $_;}
0 0
- perl 发送短信
- 发送短信
- 发送短信
- 发送短信
- 短信发送
- 发送短信
- 发送短信
- 短信发送。
- 发送短信
- 发送短信
- 短信发送
- 发送短信
- 短信发送
- 发送短信
- 短信发送
- 短信发送
- 短信发送
- 发送短信
- WIN8 共享WIFI设置
- 签约数百家移动互联企业 睿峰加速人才推广平台化进程
- GDB调试多线程
- Linux必学的60个命令
- Git使用(1)
- perl 发送短信
- 三,默认沙箱
- Android ProgressBar详解以及自定义
- UILabel圆角
- Longest Substring Without Repeating Characters
- Unix 系统数据文件和信息
- A Math game
- 美元/日元提前异动 非农数据又遇“泄密门”?
- CSS3圆角详解