[techtalk] cgi - mail question

Shelly L. Hokanson guppy3 at home.com
Tue Jun 27 23:57:23 EST 2000


hi all -

any cgi programmers out there?

this is slightly un-linux, but i'm teaching a web prog course, and the
school uses micro$oft personal web server as their web server for the
students to learn on. i've simulated that environment (blah) at home to test
some cgi scripts in perl that i'd like to use for the class.

i'm using the net-lib package (with active-perl for windoze) for a simple
web based emailer via SMTP. wondering if anyone has any experience using
this module with any of the major ISP's, or if i must be running my own mail
server as well in order for it to work.

the cgi script basically takes form input from a user, then uses the smtp
net package w/ datasend & dataend to send the form input out via smtp. short
and sweet. the script fails when attempting to call the function 'mail'
that's built into this module. according to the documentation, a value
returned as undefined is the equivalent of a failure, which is what happens
to me upon calling the mail function.

here's the mail script in perl - commented out to avoid problems!

thanks all -

shelly

# shebang line ignored by windows
# mail.pl - sends email from a web based form

#use Net::SMTP;
#use CGI qw/:standard/;

#my $to = param("TO");
#my $from = param("FROM");
#my $subject = param("SUBJECT");
#my $message = param("MESSAGE");
#my $mailserver = param("MAILSERVER");

#print header;
#print "<H3>The request has been Processed. ";
#print "Thank you $from</H3>";

#$smtp = Net::SMTP->new($mailserver);

#$smtp->mail($ENV{USER});
#$smtp->to("$to");
#$smtp->data();
#$smtp->datasend("From: $from \n");
#$smtp->datasend("Subject: $subject \n");
#$smpt->datasend("\n");
#$smtp->datasend("$message \n");
#$smtp->dataend();

#$smtp->quit;

techchron.com beta 2
http://jove.prohosting.com/~tchron






More information about the Techtalk mailing list