1 | perl -MCPAN -e shell |
1 2 3 | cpan shell -- CPAN exploration and modules installation (v1.9205) ReadLine support available (maybe install Bundle::CPAN or Bundle::CPANxxl?) cpan[1]> |
1 | cpan[1]> install Mail::Mailer |
1 | Mail::Mailer->new(TYPE, ARGS) |
1 | $obj->open(HASH) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #!/usr/bin/perl – w use Mail::Mailer; # 构造 Mail::Mailer 对象 my $mail = Mail::Mailer->new( ‘ sendmail ’ ) or die “Couldn ’ t create Mail::Mailer object!\n”; # 构建邮件 $mail_headers->open( { From => 'root@root-desktop', To => 'yourname@yourmail.com', Subject => 'Mail::Mailer is used', } ); # 发送邮件 print $mail “This is the body part of the message you can write your message here”; $mail->close($mail_headers); exit 0; |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |