Halihallo (dieses mal etwas informativer ;-))
MIME::Entity -> build, attach
Mail::Mailer -> send...
war vielleicht etwas wenig:
aus der Doku zu MIME::Entity:
### Create an entity:
$top = MIME::Entity->build(From => 'me@myhost.com',
To => 'you@yourhost.com',
Subject => "Hello, nurse!",
Data => @my_message);
### Attach stuff to it:
$top->attach(Path => $gif_path,
Type => "image/gif",
Encoding => "base64");
aus sendmail (Linuxprogi zum versenden von E-Mails)
my $sendmail = "/usr/sbin/sendmail -t";
open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!";
print SENDMAIL $content;
close(SENDMAIL);
zusammengesetzt:
my @message = ('Hallo xxx,', 'Hier die Postkarte...');
my $to = 'receiver@email.com';
my $from = 'you@you.com';
my $file = './jpeg-files/postcard001.jpeg';
my $sendmail = "/usr/sbin/sendmail -t";
$top = MIME::Entity->build(From => $from,
To => $to,
Subject => $subj,
Data => @message);
### Attach stuff to it:
$top->attach(Path => $file,
Type => "image/jpeg",
Encoding => "base64");
open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!";
print SENDMAIL $top->as_string;
close(SENDMAIL);
so sollte das in etwa funktionieren...
Viele Grüsse
Philipp
<-- heute mal als unprofessioneller Codezusammenschnipsler unterwegs :-)