in reply to Email form letters

Just a follow up...

Using the example (below)in the Active State docs suggested by Odud, I get a "Bad command of file name" error from DOS. The email, however, is sent normally.

Stepping through the code in the debugger, I see that the error is trigged by line 5, which initializes the smtp connection. I realize this may be as much a Win98 question as a Perl one, but I'm hoping someone can explain it to me. Thanks again for all your help.

use Net::SMTP;

$smtp = Net::SMTP->new('xp.psych.nyu.edu'); # connect to an SMTP server

$smtp->mail( 'zoubok@psych.nyu.edu' );  # use the sender's address here
        
$smtp->to('szoubok@flexdesigns.com'); # recipient's address

$smtp->data();  # Start the mail

# Send the header.
#
$smtp->datasend("To: szoubok\@flexdesigns.com\n");
$smtp->datasend("From: zoubok\@psych.nyu.edu\n");
$smtp->datasend("\n");

# Send the body.
$smtp->datasend("Hello, World!\n");

$smtp->dataend();  # Finish sending the mail
$smtp->quit;       # Close the SMTP connection