www- why won't this work?! 
Author Message
 www- why won't this work?!

This is my theoretical mailing script... it takes a www form into perl and
is supposed to telnet to port 25 of my host and mail me a message, but it
doesn't work...  could someone tell me what's wrong with my code or how i
could do it easier?  

-----
#!/usr/local/bin/perl

print "Content-type: text/html\n\n";

print "<TITLE>Left a Message for Jason Patterson</TITLE>\n";

print "<H1>Here's the message that has been sent to Jason:</h1>\n";

print "<ul>\n";

$_=<>;
s/\+/ /g;

($name,$address,$reference,$message) = split("&",$_);

$name =~ /(.*)=(.*)/;
print "<li>Name:      $2\n";
$name=$2;

$address =~ /(.*)=(.*)/;
print "<li>E-mail:    $2\n";
$address=$2;

$reference =~ /(.*)=(.*)/;
print "<li>Reference: $2\n";
$reference=$2;

$message =~ /(.*)=(.*)/;

$message=$2;

print "<li>Message:<p>\n\n$message\n";

$datestring = `date`;
chop($datestring);

open(OUTFILE,"| telnet dirac.scri.fsu.edu 25");

print OUTFILE "helo\n";
print OUTFILE "mail from: <$address>\n";

print OUTFILE "data\n";
print OUTFILE "$message\n\n";
print OUTFILE ".\n";
print OUTFILE "quit\n";

close OUTFILE;

print "</ul>\n";

print "<p><hr>\n";

print "<p><h2>Thank you for visiting the pages of Jason Patterson</h2><p>\n";

------

i hope someone out there can follow this... also, the message that the html
generates has a bunch of %20's and %0A, which I guess stand for spaces and
carriage returns...  any way i could get rid of all these?    thanks a lot.
latre..

-------------------------------------------------------------------------------




 the nin home page is at www link: " http://www.*-*-*.com/ ~patters/nin.html"
 "i'm stuck in this dream it's changing me i am becoming" - trent reznor - nin

-------------------------------------------------------------------------------



Fri, 25 Apr 1997 10:45:18 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. regex --- why won't this work?

2. Why won't this script work???

3. Reformated Why won't this work.

4. Why won't my for loop work?

5. Why won't my RE work (PL18)?

6. why won't the cgi work

7. Why won't this little script work?

8. Any idea why this won't work?

9. why won't this cgi script work?

10. Why won't this simple script work??

11. Why won't this work?

12. basic code -- why won't it work??!!

 

 
Powered by phpBB® Forum Software