#!/usr/bin/perl -w use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use MIME::Lite; # mail protokoll use strict; my ($mail_adress); $user = $ENV{'REMOTE_HOST'}; $mail_adress = $user; open(MAIL , "| /usr/sbin/sendmail -t") ; my $msg = new MIME::Lite ; my $tomail= "$mail_adress\@adresse.ch" ; my $frommail="name\@adresse.ch" ; $msg = build MIME::Lite From => $frommail , To => $tomail , Subject => "Test Mail" , Type => 'TEXT', Data => "Test Mail: Dies ist ihre Abfrage." ; attach $msg Type => "text/txt" , Path => "test.txt" , Encoding => "base64" , Filename => "test.txt" ; $msg->print(\*MAIL) ; close(MAIL) ;