From: "David H. Lynch Jr." <[EMAIL PROTECTED]>
> Below is a perlscript to do approximately what you asked. I found it
> somewhere else on the web. Unfortunately I do not remember where, and
> I have seen several similar. It is pretty basic anyway.
>
> #!/usr/bin/Perl
>
> use MIME::QuotedPrint;
> use MIME::Base64;
> use Mail::Sendmail 0.75; # doesn't work with v. 0.74!
>
> $file = $ARGV[0] ;
> $to = $ARGV[1] ;
> $msg = $ARGV[2] ;
>
> %mail = (
> SMTP => 'mail.yourdomain.com',
> from => '[EMAIL PROTECTED]',
> to => "$to",
> subject => "This is your e-mail subject",
> );
>
>
> $boundary = "====" . time() . "====";
> $mail{'content-type'} = "multipart/mixed; boundary=\"$boundary\"";
...
use Mail::Sender;
$file = $ARGV[0] ;
$to = $ARGV[1] ;
$msg = $ARGV[2] ;
my $sender = new Mail::Sender {smtp => 'mail.yourdomain.com'};
die "Can't send the email: $Mail::Sender::Error\n"
unless ref $sender;
if (! ref $sender->MailFile({
from => '[EMAIL PROTECTED]',
to => $to,
subject => "This is your e-mail subject",
msg => $msg,
file => $file,
b_encoding => 'quoted-printable',
b_ctype => 'text/plain; charset="iso-8859-1"'
})) {
die "Can't send the email: $Mail::Sender::Error\n";
}
Jenda
(Untested, but should be fine.)
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]