Hi Juergen,
this a think that took me some time to figure it out by myself. But here we go:
open(FILE, "< test.txt") or die "$!";
{local ($/) = undef; $fileline = <FILE>;}
#the whole file is now in one string!
close (FILE);
$dummy = pack('u', $fileline);
#the command pack supports a lot of different commands
#now, the whole mime packed file should be in $dummy
before you now print that string to you mail please be advised to tell the
program what it is.
before the string something like
"begin 666 $filename\n"
$dummy
'
end
try that an check it out on http://friedirus.virtualave.net/
Julian Dittrich
----- Original Message -----
From: Mueller, Juergen (pro.vider GmbH iG) <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 25, 2000 6:29 PM
Subject: attaching a document
: Hello,
:
: I'm not quite sure if this is the right list for my question, anyway... ;-)
:
: If one wants to generate an email, the perl-code surely looks something like
: that:
:
: open(MAIL,"|$mailprog -t");
:
: print MAIL "To: info\@host.de\n";
: print MAIL "From: $input{'absender'}\n";
: print MAIL "Subject: Hallo Juergen\n\n";
: print MAIL "\n";
: print MAIL "Text der Email\n";
: print MAIL "blabla ...\n\n";
:
: close (MAIL);
:
:
: Questions:
: What is the code to attache a document to such a script-generated email?
:
: Thanks a lot.
:
: Juergen
: