#!\usr\bin\perl -wT use strict; use Net::SMTP; use CGI qw ( :standard ); my ( $from, $to, $subject, $message, $address, $server, $myAddress ); $from = param( "from" ); $to = param( "to" ); $subject = param( "subject" ); $message = param( "message" ); $address = param( "address" ); $server = param( "server" ); $myAddress = param( "myAddress" ); my $smtp = new Net::SMTP( "$server", Hello => "$server" ) or die "Ughh! Unable to send email : $!\n"; $smtp->to( "$to ); $smtp->mail( "$myAddress" ); $smtp->data(); $smtp->datasend( "From: $from\n" ); $smtp->datasend( "To: $to\n" ); $smtp->datasend( "Subject: $subject\n\n\n" ); $smtp->datasend( "$message\n" ); $smtp->dataend(); $smtp->quit();