Приглашаем посетить
Win Mail
# This is a simple work around for those on Windows NT or 95
# machines that want to use Perl scripts to send e-mail
#
# written by: Dave Palmer
# http://upstatepress.com/dave/perl.shtml
# (c) 1997 Dave Palmer
#
# You will need to obtain the latest copy of Blat.exe
# It must be properly installed on your system in order
# for this to work.
#
# Usage:
# In your main program add a require statement:
# require 'winmail.pl';
#
# To call WinMail, simply use the following syntax:
# &SendMail(c:/path/to/blat.exe, c:/path/to/temp/directory/, Subject line, To:, message text);
#
# Here's an example:
# &SendmMail(c:/blat/blat.exe, c:/windows/temp/, This is cool, dave@upstatepress.com, My test message);
# Of course, most of the time, this can be greatly simplified by using variables:
# &SendMail($mailprog, $temp, $subject, $recipient, $content);
sub SendMail {
local($blat, $tempfile, $subject, $to, $message) = @_;
open(MAIL, ">$tempfile/mailtemp.txt") || die $!;
print MAIL "$message\n";
close(MAIL);
exec("$blat $tempfile -s \"$subject\" -t $to \n\n");
}