#!/usr/bin/perl -w
use MIME::Lite;
use Getopt::Std;
$FROM = 'me@example.com'; ### CHANGE THIS DEFAULT
# MIME::Lite->send('smtp', "localhost:1025", Timeout=>60);
### Uncomment that line and adjust to send via specified SMTP server
getopts('t:s:', \%o);
$o{t} ||= $FROM;
$o{s} ||= 'Your binary file, sir';
unless (@ARGV) {
die "usage:\n\t$0 [-s subject] [-t to] file...\n";
}
$msg = new MIME::Lite(
From => $FROM,
To => $o{t},
Subject => $o{s},
Data => "Hi",
Type => "multipart/mixed",
);
while (@ARGV) {
$msg->attach('Type' => 'application/octet-stream',
'Encoding' => 'base64',
'Path' => shift @ARGV);
}
$msg->send();
--Nat
Did just the same thing today (Score:1)
Re:Did just the same thing today (Score:2)
Re:Did just the same thing today (Score:2)
--Nat
(I thank perlmonks every time I use that!)