Perl

Moderators: Jonathan
Number of threads: 1211
Number of posts: 3568

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Getting form FIELDS picked up for e-mailing with Net::SMTP Posted by Tiradientes on 1 Mar 2010 at 8:34 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:

<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:
#!/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";




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.