At 03:02 PM 10/29/2000 -0600, Mike Benedict wrote:
>> doesn't sound to me like you have a compelling reason to need 5.6,
>> though, so the 5.5 kit supported by Compaq might be less hassle
>
>You had my hopes up there for a moment. Turns out they require VMS 7.2
>where I'm running 7.1-2. :-(
I suspect this has more to do with how software support contracts work than with how
the software works, and also with how Perl is institutionally (though not technically)
tied to Apache. If your C RTL is up to snuff then I doubt you'd have any problems,
but of course can't promise anything.
>> I don't know what is causing the syntax error you are seeing.
>
>Do you suppose that this could this be related to a test failure of the
>VMSISH module?
It's certainly worth getting a clean build and test before worrying about that.
>> you might consider using MIME:Lite or Net::SMTP to send
>> messages using Perl alone rather than a mix of Perl and
>> DCL, though there's > nothing inherently wrong with
>> your approach either.
>
>I'm only trying the mixed Perl/DCL route until I can get my install of PERL
>fixed up, otherwise, I'd much rather have everything self contained in the
>script.
>
>> I have examples using those Perl modules if you want them.
>
>Yes, please!
Here's a very simple example of using MIME::Lite to send a file as an attachment.
There are more examples with the module, which you can get from
<http://search.cpan.org/search?dist=MIME-Lite>.
#perl
use MIME::Lite;
MIME::Lite->send('smtp', "smtp.yourdomain.com", Timeout=>60);
$file = shift @ARGV;
$recipients = shift @ARGV;
$subject = 'This message tests attachment reception [octet-stream].';
$message = "The attachment should be named $file\n";
if (&mail_file( $file, $recipients, $subject, $message ))
{
print "Mailed $file to $recipients.\n";
}
else
{
print "Error mailing $file to $recipients\n";
$error_count++;
}
exit;
#-------------------------------------------------------------------------------
# This routine actually mails the file as an attachment using base64 encoding.
sub mail_file
{
my ($path, $recipients, $subject, $message) = @_;
# Create a new message object.
my @recipient_list = split( /,\s*/, $recipients );
my $msg = new MIME::Lite
From =>$ENV{USER},
To =>\@recipient_list,
Subject =>$subject,
Type =>'TEXT',
Encoding=>'quoted-printable',
Data =>$message;
my $filename = $path;
$filename =~ s/^.*\]//; # strip VMS dir spec
$filename =~ s/^.*\://; # strip dir spec for rooted logicals
if ($path)
{
# Attach a file to the message.
attach $msg Type =>'application/octet-stream',
Path =>$path,
Filename =>$filename,
Encoding =>'base64',
Disposition =>'attachment';
}
return $msg->send;
}
_______________________________________________
Craig A. Berry
mailto:[EMAIL PROTECTED]