#!c:\perl\bin\perlis.dll #************************************************************************** # # Contact Us # # #************************************************************************** use Net::SMTP; use strict; use CGI; my $query = new CGI; my $to_email="info\@superturn.co.uk"; my $from_email = "info\@superturn.co.uk"; my $subject="Website Enquiry."; # # Output Page # my $header=""; $header = <<"EOF"; Bolts Nuts fasteners, Industrial fasteners - Super Alloy CNC Turning
EOF # # Process the input # my $page=""; my $errors=""; my $send_email = 0; my $name = $query->param("name"); my $address1 = $query->param("address1"); my $address2 = $query->param("address2"); my $city = $query->param("city"); my $county = $query->param("county"); my $postcode = $query->param("postcode"); my $phone = $query->param("phone"); my $email = $query->param("email"); my $comments = $query->param("comments"); my $comments2 = $query->param("comments2"); my $quantity = $query->param("quantity"); my $process = $query->param("process"); if ($process eq "process"){ if ($name eq ""){ $errors .= "Please enter your name.
"; } if ($email eq ""){ $errors .= "You must enter an email address.
"; } if ($comments2 eq ""){ $errors .= "Please enter additional comments.
"; } if ($errors eq ""){ $send_email=1; } } if ($send_email==1){ my $message_data; $message_data = "\n\nName: $name \n"; $message_data.= "Address (1): $address1\n"; $message_data.= "Address (2): $address2\n"; $message_data.= "City: $city\n"; $message_data.= "County: $county\n"; $message_data.= "Postcode: $postcode\n"; $message_data.= "Telephone: $phone\n"; $message_data.= "Email: $email\n"; $message_data.= "Part Numbers: $comments\n"; $message_data.= "Quantity: $quantity\n"; $message_data.= "Comments: $comments2\n"; # Escape String $message_data =~ s/@/\@/g; my $smtp = Net::SMTP->new("localhost",Hello => 'localhost', Timeout => 60); $smtp->mail("$from_email"); $smtp->recipient("$to_email"); #$smtp->to("$email_to"); #$smtp->cc(""); #$smtp->bcc(""); # Start the data segment $smtp->data; # Send the message headers $smtp->datasend("From: $from_email\n"); $smtp->datasend("To: $to_email\n"); $smtp->datasend("Subject: $subject\n"); $smtp->datasend("\n"); # Send the message body $smtp->datasend($message_data); # Finish and send. $smtp->dataend; $smtp->quit; } if ($send_email==1){ print $header; print <<"EOF";
   
EOF my $footer=""; $footer = <<"EOF";
SUPERTURN, Clipper Road, Leicester, LE4 9JE, United Kingdom
Tel: 0116 246 0118 - Fax: 0116 350 0161

Home  I  About us  I  Market  I  Products & Services  I  Career  I  Email

Copyright 2008 SUPERTURN
All Rights Reserved.


Aerospace Fasteners   
 
Thank you for your enquiry. Your email has been sent, a member of our team will reply shortly.


EOF print $footer; } else { print $header; print <<"EOF";
REQUEST INFORMATION  
$errors
Name:

*Required
Address:


City:
County:
Postcode
Phone:
Email:

*Required
Additional Comments :
*Required
   
EOF print $footer; }