Chinaunix首页 | 论坛 | 博客
  • 博客访问: 655
  • 博文数量: 0
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 10
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-24 22:15
我的朋友
最近访客
     该分类下暂时没有公开的博文,给他留言提醒一下吧。
给主人留下些什么吧!~~

yesir6502014-09-08 11:14

#!/usr/bin/perl -w
use strict;
use Net::SMTP;
my $to = '1184013290@qq.com';
my $from = 'yesir650@126.com';
my $site = 'mail.126.com';
my $smtp_host = 'smtp.126.com';
my $pop_host = 'pop3.126.com';
my $username = "yesir650";
my $password = "8636714";
&writeAMesg;
sub writeAMesg{
     my $smtp = Net::SMTP->new( $smtp_host, Timeout=>60, Debug=>1 );
     $smtp->auth($username, $password);
     $smtp->mail( $from );
     $smtp->to( $to );
     $smtp->data();

     $smtp->datasend("To: $to\n");
     $smtp->datasend("Subject: A message from server\n");
     $smtp->datasend("\n");
     $smtp->datasend("This is just to let you know\n");
     $smtp->datasend("The flight is coming, Please check it out on time.\n");
     $smtp->datasend("\n");

     $smtp->dataend();
     $smtp->quit;
}
运行后报: can't call method "auth" on an undefined value at line 14  
请教啥问题?

回复  |  举报
留言热议
请登录后留言。

登录 注册