G
Gordon
Hi...
Ouch - I'm stumped!
I use forms to email on lots of my sites - all of which run on Unix servers.
There seem to be lots of easy and free scripts available.
I have a new site running on Widows 2000 servers and simply can't find a
script that works.
I'm presently trying to use a .pl script, which the ISP in question
provided, but which only sends the contents of a single message field.
I need to have separate fields for Name, Address, email, phone, and message,
all to be sent in the email.
Does anyone know how to add to the .pl script below the instructions to send
the other fields as well.
Any help appreciated...
Gordon
# Use the cgi module.
use cgi;
# Get values from sample form.
$form = new CGI;
# This is the name of the person sending the email.
$sender = $form->param('sender');
# This is the address the email is being sent from.
# This must be a valid domain hosted on the server.
$from = $form->param('from');
# This is the name of the recipient of the email.
$recipient = $form->param('recipient');
# This is the email address that the message should be sent to.
$to = $form->param('to');
# This is the subject header for the email.
$subject = $form->param('subject');
# This is the address of the SMTP server to use to send the email.
$smtp = "mail.newnet.co.uk";
# This is the email message.
$message = $form->param('message');
$lt='<';
$gt='>';
# Save the message into a text file.
open (messtxt,">message.txt");
print messtxt ($message);
close messtxt;
# Build the Blat command line.
# $blat="blat.exe message.txt -s \"$subject\" -t
\"$lt$to$gt$recipient\" -server $smtp -f \"$lt$from$gt$sender\"";
$blat="blat.exe message.txt -s \"$subject\" -t \"$to\" -server $smtp -f
\"$from\"";
# Execute the command to send the email.
system($blat);
# Command to redirect the user to another webpage.
# Change the url below to the url of the page you wish to redirect to.
$redirect = "http://www.mydomain.com";
print "Content-type: text/html\n\n";
print "<HTML><HEAD>";
print "<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=$redirect\">";
print "</HEAD><BODY>";
# Uncomment the lines below to display the mail sent message in the browser.
# print $blat;
# print "<br><br>Done.<br><br>";
# print "Mail sent to $to.";
print "</BODY></HTML>";
Ouch - I'm stumped!
I use forms to email on lots of my sites - all of which run on Unix servers.
There seem to be lots of easy and free scripts available.
I have a new site running on Widows 2000 servers and simply can't find a
script that works.
I'm presently trying to use a .pl script, which the ISP in question
provided, but which only sends the contents of a single message field.
I need to have separate fields for Name, Address, email, phone, and message,
all to be sent in the email.
Does anyone know how to add to the .pl script below the instructions to send
the other fields as well.
Any help appreciated...
Gordon
# Use the cgi module.
use cgi;
# Get values from sample form.
$form = new CGI;
# This is the name of the person sending the email.
$sender = $form->param('sender');
# This is the address the email is being sent from.
# This must be a valid domain hosted on the server.
$from = $form->param('from');
# This is the name of the recipient of the email.
$recipient = $form->param('recipient');
# This is the email address that the message should be sent to.
$to = $form->param('to');
# This is the subject header for the email.
$subject = $form->param('subject');
# This is the address of the SMTP server to use to send the email.
$smtp = "mail.newnet.co.uk";
# This is the email message.
$message = $form->param('message');
$lt='<';
$gt='>';
# Save the message into a text file.
open (messtxt,">message.txt");
print messtxt ($message);
close messtxt;
# Build the Blat command line.
# $blat="blat.exe message.txt -s \"$subject\" -t
\"$lt$to$gt$recipient\" -server $smtp -f \"$lt$from$gt$sender\"";
$blat="blat.exe message.txt -s \"$subject\" -t \"$to\" -server $smtp -f
\"$from\"";
# Execute the command to send the email.
system($blat);
# Command to redirect the user to another webpage.
# Change the url below to the url of the page you wish to redirect to.
$redirect = "http://www.mydomain.com";
print "Content-type: text/html\n\n";
print "<HTML><HEAD>";
print "<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=$redirect\">";
print "</HEAD><BODY>";
# Uncomment the lines below to display the mail sent message in the browser.
# print $blat;
# print "<br><br>Done.<br><br>";
# print "Mail sent to $to.";
print "</BODY></HTML>";