use strict; use warnings; use CGI::Pretty qw(:standard); use MIME::Lite; my @FIELD = qw( name email address1 address2 city state zip homephone workphone business goals comments ); print header; if (param('mail_it')) { my $data = join('', map "$_: " . param($_) . "\n", @FIELD); my $msg = MIME::Lite->new( From => 'webmaster@prowebdesigner.net', To => 'webmaster@prowebdesigner.net', Subject => 'Website Design Request', Data => $data, ); if ($msg->send) { print start_html('The Thank You'), p(' YOUR potential business is VERY IMPORTANT to PRO WEB DESIGN. We will respond as soon as we can. '), ; print p('Here is what you submitted:'), ul( li[map b("\u$_\E: ") . param($_), @FIELD]), ; } else { print start_html('The Oopsie'), p('whoops! something went wrong!'), } } else { print start_html('The Form'), start_form, (map "$_: ".textfield($_).br, @FIELD), submit('mail_it'), end_form, ; } print end_html;