Hello there...
Has anybody tried this...?
These sort of scripts generally cause people to ask, ``is there a sendmail equivalent on Windows?'' If you need to send email from a Perl
script, there is no need to use an external program like sendmail. The libnet bundle includes Net::SMTP, a module that can be used to
send mail. Here is an example:
use Net::SMTP;
$smtp = Net::SMTP->new('here.com'); # connect to an SMTP server
$smtp->mail( 'user@here.com' ); # use the sender's address here
$smtp->to('user@there.com'); # recipient's address
$smtp->data(); # Start the mail
# Send the header.
#
$smtp->datasend("To: user@there.com\n");
$smtp->datasend("From: user@here.com\n");
$smtp->datasend("\n");
# Send the body.
#
$smtp->datasend("Hello, World!\n");
$smtp->dataend(); # Finish sending the mail
$smtp->quit; # Close the SMTP connection
It seems like a pretty easy way of sending mail using Windows NT
Cheers
-JO
Has anybody tried this...?
These sort of scripts generally cause people to ask, ``is there a sendmail equivalent on Windows?'' If you need to send email from a Perl
script, there is no need to use an external program like sendmail. The libnet bundle includes Net::SMTP, a module that can be used to
send mail. Here is an example:
use Net::SMTP;
$smtp = Net::SMTP->new('here.com'); # connect to an SMTP server
$smtp->mail( 'user@here.com' ); # use the sender's address here
$smtp->to('user@there.com'); # recipient's address
$smtp->data(); # Start the mail
# Send the header.
#
$smtp->datasend("To: user@there.com\n");
$smtp->datasend("From: user@here.com\n");
$smtp->datasend("\n");
# Send the body.
#
$smtp->datasend("Hello, World!\n");
$smtp->dataend(); # Finish sending the mail
$smtp->quit; # Close the SMTP connection
It seems like a pretty easy way of sending mail using Windows NT
Cheers
-JO