#!/usr/bin/perl -w use strict; use CGI; use CGI::Carp qw(fatalsToBrowser); my $mailprog = '/usr/sbin/sendmail -t'; my $email = 'zzz@hotmail.com'; my %mail_address = ("France" => 'xxx@hotmail.com', "Germany" => 'yyy@hotmail.com'); my $cgi = CGI-new; print $cgi-header; my %FORM = $cgi-Vars; my $mail_destination = $mail_address{$FORM{'Destination'}}; $email = $FORM{'email'}; my $Destination = $FORM{'Destination'}; my $yourname = $FORM{'yourname'}; my $message = $FORM{'message'}; open (MAIL, "| $mailprog") || print "Can't open $mailprog!\n"; print (MAIL "From: $email\n"); print (MAIL "To: $mail_destination\n\n"); while (($key,$value) = each %FORM){ print MAIL "$key\: $value\n"; } close MAIL;