Thread MIME::Lite attachment => file not readable
(15 answers)
Opened by dafanky at 2008-08-19 14:25
code:
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 #!/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) ; //ModEdit GwenDragon: CODE-Tags hinzugefügt |