# individual-Mail senden! my $mime_msg = MIME::Lite->new( From => "$absender_name <$absender_email>", To => $empfaenger_mail, Subject => $betreff, Type => 'text/html', Data => qq{$nachricht} ) or $error=1; if ($error == 1){ push @rueckgabe, "Fehler beim vorbereiten der MIME E-Mail aufgetreten."; next; } my $file_zielpath; if($file){ my $eingangpath = $file; $eingangpath =~ s/\\/\//g; my ($name, $dir, $extension) = fileparse($eingangpath, '\..*'); my $anhangfilename = $name.$extension; my $file_type = "image/".$extension; push @rueckgabe, "Hänge Datei $anhangfilename an E-Mail an."; # Attach image file $mime_msg->attach( Type => $file_type, Path => $file, Filename => $anhangfilename, ) or $error=1; if ($error == 1){ push @rueckgabe, "Fehler: Die Datei konnte nicht angehängt werden."; next; } } # Actually have MIME::Lite send the message. push @rueckgabe, "Sende E-Mail an $empfaenger_mail, result=". $mime_msg->send('sendmail', "$$CONFIG_ref{'sendmail'} -t -oi -oem");