perl发mail问题

perl发mail问题

#!/usr/bin/perl -w
open(SENDMAIL, "|/usr/lib/sendmail -oi -t -odq")
                    or die "Can't fork for sendmail: $!\n";
print SENDMAIL <<"EOF";
From: User Originating Mail <root\@localhost>
To: Final Destination <postmaster\@localhost>
Subject: here is the subject
here is the body ,GOOD LUCK!!
EOF
close(SENDMAIL)     or warn "sendmail didn't close nicely";

maillog如下
Dec 14 13:33:49 centOS02 sendmail[5509]: mBEIXnom005509: from=root, size=149, class=0, nrcpts=1, msgid=<200812141833.mBEIXnom005509@centOS02>, relay=root@localhost
Dec 14 13:33:49 centOS02 sendmail[5509]: mBEIXnom005509: to=Final Destination <postmaster@localhost>, delay=00:00:00, mailer=relay, pri=30149, stat=queued


# mail
No mail for root
哪位指点一下


QUOTE:
原帖由 bitterness 于 2008-12-24 12:51 发表
#!/usr/bin/perl -w
open(SENDMAIL, "|/usr/lib/sendmail -oi -t -odq")
                    or die "Can't fork for sendmail: $!\n";
print SENDMAIL  

我用你这个脚本可以收到邮件。