foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
# Un-Webify plus signs and %-encoding
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s/<!--(.|\n)*-->//g;
if ($allow_html != 1) {
$value =~ s/<([^>]|\n)*>//g;
}
$FORM{$name} = $value;
if ($name ne 'Submit')
{
print FILE $name;
print FILE "=";
print FILE $value;
print FILE "\n";
print HTMLFILE "<TR>\n";
print HTMLFILE "<TD>";
print HTMLFILE $name;
print HTMLFILE "</TD>\n";
print HTMLFILE "<TD>";
print HTMLFILE $value;
print HTMLFILE "</TD>\n";
print HTMLFILE "</TR>\n";
}
}
print HTMLFILE "</TABLE>";
print HTMLFILE "</BODY>";
print HTMLFILE "</HTML>";
close (FILE);
close (HTMLFILE);
my $emaillinks;
my $emailrechts;
($emaillinks, $emailrechts) = split(/@/, $email);
$cc_address = $emaillinks."\@".$emailrechts;
print "Content-type: text/html\n\n";
print "<br><br><CENTER>\n";
print "<h2>Blablabla\n";
#Email variables.
$mail_server = "xxx";
$from_address = "xxx";
$to_address = $TmpEmailAddressto;
$subject = $lastname." ".$firstname." xxx";
$body = "body";
$mimeType = "text/html";
$message_body = "<HTML><BODY><CENTER><h2>Absender: ".$lastname." ".$firstname." ".$ValA."</H2></CENTER></BODY></HTML>";
MIME::Lite->send("smtp", $mail_server);
# Create the initial text of the message
$mime_msg = MIME::Lite->new(
From => $from_address,
To => $to_address,
Cc => $cc_address,
Subject => $subject,
Type => $mimeType,
Data => $message_body
) or die "Error creating MIME body: $!\n";
$mime_msg->attach(
Type => "text/html",
Disposition => "attachment",
Path => $htmlfilename,
Filename => $htmlfilename,
);
$mime_msg->send();