Tiradientes
03-01-2010, 09:25 PM
When I SUBMIT a POST form from HTML, all I get in the e-mail that is sent to me are the names of the fields, but the field data is not copied. Any help would be greatly appreciated.
First, the simple HTML code: [code]
<form action="http://my.domain/bin/forms.cgi" method="POST">
Personal name: <input type='text' name="firstname" />
Family name: <input type='text' name="familyname" />
<input type="submit" value=" Send " />
</form>
Next, the corresponding CGI: [code]
#!/usr/bin/perl - -
use Net::SMTP;
$smtp = Net::SMTP->new('smtp.my.domain', Timeout => 60);
$smtp->mail('mymail@nanzan-u.ac.jp');
$smtp->recipient('mymail@nanzan-u.ac.jp');
$firstname = ('firstname');
$familyname = ('familyname');
$smtp->data;
$smtp->datasend("From: heisig\@nanzan-u.ac.jp\n");
$smtp->datasend("To: heisig\@nanzan-u.ac.jp\n");
$smtp->datasend("Subject: Special-order book\n");
$smtp->datasend("\n");
$smtp->datasend("$firstname familyname") ;
$smtp->datasend("\n") ;
$smtp->dataend;
$smtp->quit;
print "Content-type:text/html\n\n";
print "done.\n";
First, the simple HTML code: [code]
<form action="http://my.domain/bin/forms.cgi" method="POST">
Personal name: <input type='text' name="firstname" />
Family name: <input type='text' name="familyname" />
<input type="submit" value=" Send " />
</form>
Next, the corresponding CGI: [code]
#!/usr/bin/perl - -
use Net::SMTP;
$smtp = Net::SMTP->new('smtp.my.domain', Timeout => 60);
$smtp->mail('mymail@nanzan-u.ac.jp');
$smtp->recipient('mymail@nanzan-u.ac.jp');
$firstname = ('firstname');
$familyname = ('familyname');
$smtp->data;
$smtp->datasend("From: heisig\@nanzan-u.ac.jp\n");
$smtp->datasend("To: heisig\@nanzan-u.ac.jp\n");
$smtp->datasend("Subject: Special-order book\n");
$smtp->datasend("\n");
$smtp->datasend("$firstname familyname") ;
$smtp->datasend("\n") ;
$smtp->dataend;
$smtp->quit;
print "Content-type:text/html\n\n";
print "done.\n";