#!/usr/bin/perl -w use strict; use CGI; use CGI::Carp qw/ fatalsToBrowser /; # but never in # production use MIME::Lite; my $q=new CGI; my @contents=(); foreach my $key($q->param) { # There is a problem with this code, I'll explain # later. push @contents,sprintf("%s = %s",$key,$q->param($key)); } my $mail=new MIME::Lite ( From => 'me@here.com', To => 'you@there.com', Subject => 'contents of my form', Type => "TEXT", Data => join("\n",@contents) ); MIME::Lite->send("smtp","my.smtphost.com",120); $mail -> send;