There are lots of scripts around that do this and I have written one myself that will email a file that is uploaded from a form or fetched using Net::FTP
I use
use MIME::Base64 qw(encode_base64);
in my script to encode the attatchent. This is supposed to be around 24 times faster than encoding with the perl encode sub.
You then need to send the content type in the header and define the boundary...
my @boundaryv = (0..9, 'A'..'F');
srand(time ^ $$);
for (my $i = 0; $i < 24;) {
$boundary .= $boundaryv[rand(@boundaryv)];
}
Then define Content-Transfer-Encoding and Content-Disposition.
Then encode the attatchment and send.
Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/
I use
use MIME::Base64 qw(encode_base64);
in my script to encode the attatchent. This is supposed to be around 24 times faster than encoding with the perl encode sub.
You then need to send the content type in the header and define the boundary...
my @boundaryv = (0..9, 'A'..'F');
srand(time ^ $$);
for (my $i = 0; $i < 24;) {
$boundary .= $boundaryv[rand(@boundaryv)];
}
Then define Content-Transfer-Encoding and Content-Disposition.
Then encode the attatchment and send.
Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/