Check Domain Name


PERL mail script for LINUX

The following is the Sample Form Code and followed by the PERL script :


PERL Code


#!/usr/bin/perl
print "Content-type: text/html\n\r\n\r";
use Mail::Sendmail 0.75;
# Read from the sandard input
read(STDIN,$query,$ENV{'CONTENT_LENGTH'});
$input = parseQs($query);
print("To --- $input->{to} <br>");
print("cc --- $input->{cc} <br>");
print("message --- $input->{message}<br>");
$message=$input->{message};
print("submit --- $input->{submit}<br>");
$head="This is a multi-part message in MIME format.";
$head=$head."Content-Type: text/plain; charset=us-ascii";
$head=$head."Content-Transfer-Encoding: 7bit";
# Mailing pare from here
#print "Content-type: text/html\n\r\n\r";
%mail = ( SMTP => 'smtp.rdsindia.com' , From
=>'sricharan@rdsindia.com', To
=>$input->{to},Subject =>
$input->{sub},Message=>$input->{message} );
sendmail(%mail) || print "Error: $Mail::Sendmail::error\n";
print ("ypur message has been sent");

#-------------------------
sub parseQs{
my $query= shift;
my (%input,@elements,$element,$key,$value );
@elements=split(/&/,$query);
for $element(@elements) {
$element =~ tr/+/ /;
($key,$value)=split(/=/,$element);
$key =~ s/%([\dA-Fa-f]{2})/pack("C",hex($1))/ge;
$value =~ s/%([\dA-Fa-f]{2})/pack("C",hex($1))/ge;
if (defined $input{$key}) {
$input{$key} .= "\0$value";
}
else {
$input{$key}=$value;
}

}
\%input;
}

Visit Indian SEO for Search Engine Optimization Website
Maintenance Services Bangalore India
Visit indianattire.com for Indian attire
Copy Right 2001 - 2005 All Rights Reserved Terms and Conditions