use CGI; use warnings; use strict; use CGI::Carp qw/fatalsToBrowser/; use Net::SMTP; my $query = new CGI; print $query->header(); my $smtp = Net::SMTP->new( Host => 'mailhost.from.com', Hello => 'thishost.from.com' ); $smtp->mail('from@from.com'); $smtp->to('to@to.com'); $smtp->data('this is the text of the message'); $smtp->quit;