#!/usr/bin/perl ### Variablen erzeugen my $to = "$ARGV[0]\@domain"; my $from = "$ARGV[1]"; my $replay = "email"; my $subject = "$ARGV[2] $ARGV[3] $ARGV[4]"; my $workdir = "$ARGV[7]"; my $tempdir = "$ARGV[7]/tmp"; my $cwffile = "$ARGV[6]"; my $htmlfile = "$ARGV[5]"; ### Modul einbinden use MIME::Lite; ### "Container" für die Multipartmessage erstellen $msg = MIME::Lite->new( From =>"$from", To =>"$to", ReplyTo =>"$replay", Subject =>"$subject", Type =>'multipart/related', ); ### HTML-Datei öffnen, lesen, Inhalt in die Email schreiben und schließen open(FILE, "$tempdir/$htmlfile") or die "Can't open data: '$htmlfile'!\n$!"; read(FILE, $buf, 60*57); $msg->attach( Type =>'text/html', Data =>"$buf" ); close(FILE); ### Erstes Bild einbetten $msg->attach( Type =>'image/gif', Encoding =>'base64', Filename =>'image001.gif', Disposition =>'inline', Path =>"$workdir/image001.gif" ); ### Zweites Bild einbetten $msg->attach( Type =>'image/gif', Encoding =>'base64', Filename =>'image002.gif', Disposition =>'inline', Path =>"$workdir/image002.gif" ); ### Linkfile anhängen $msg->attach( Type =>'text/plain', Encoding =>'7bit', Filename =>"$cwffile", Disposition =>'attachment', Path =>"$tempdir/$cwffile" ); ### Nachricht versenden $msg->send();