"My" selfmail.pl sieht nach Euren Tipps übrigens mittlerweile so aus. Kannst Du bitte einen gnädig-kritischen Blick darauf werfen? Danke!
#!/usr/bin/perl
use warnings;
use strict;
my $Sendmail_Prog = "/usr/sbin/sendmail";
my $mailto = "meine E-Mail-Adresse";
use CGI;
use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
print "Content-Type: text/html\n\n";
my $query = new CGI;
@names = $query->param;
my $delimiter = $query->param('delimiter');
my $returnhtml = $query->param('return');
my $subject = $query->param('subject');
$subject =~ s/\s/ /g;
my $mailtext = "";
foreach(@names) {
$name = $_;
my @values = "";
my @values = $query->param($name);
if($name ne "return" && $name ne "subject" && $name ne "delimiter") {
foreach my $value (@values) {
$mailtext = $mailtext.$name;
$mailtext = $mailtext.$delimiter;
$mailtext = $mailtext.$value."\n";
}
}
}
open(MAIL,"|$Sendmail_Prog -t") || print STDERR "Mailprogramm konnte nicht gestartet werden\n";
print MAIL "To: $mailto\n";
print MAIL "Subject: $subject\n\n";
print MAIL "$mailtext\n";
close(MAIL);
print "Location: $returnhtml\n\n";