I'm comparing this:
my $smtp = Net::SMTP->new('localhost');
$smtp->mail($from);
$smtp->to($to);
$smtp->data();
$smtp->datasend($message);
$smtp->dataend();
$smtp->quit;
To this:
open MAIL, "|sendmail -f $from $to";
print MAIL $message;
close MAIL;
--
Bowie
I'm using both form of program. Net::SMTP I'm using if I don't know if user
have sendmail or if I want to send more mails in short time of running
script.
But for using sendmail I use this
$mailprog = '/usr/sbin/sendmail';
open(MAIL,"|$mailprog -t");
print MAIL "From: \"$from_name\" <$from_addr>\n";
print MAIL "Reply-To: $from_addr\n";
print MAIL "To: \"$to_name\" <$to_addr>\n";
print MAIL "Subject: $subj\n";
print MAIL "MIME-Version: 1\.0\n";
print MAIL "Content-Type: text\/plain\; charset\=ISO\-8859\-2\n";
print MAIL "Content-Transfer-Encoding: 8bit\n\n";
print MAIL win2iso($message),"\n\n";
close MAIL;
Petr Vileta, Czech republic
(My server reject all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs