Hi,
Stop growling and move on! Plenty of modules in the C-Pan. Fry a few.
Here are a couple of possibly easier solutions that work fine (mumble mumble
a couple of trivially fixed warnings due to InternetConfig.pm on the first
one might need to be fixed to be clean under -w. Maybe the latest version
has done this already...). Obviously the InternetConfig call in the first
example can be eliminated if you're happy to hardwire the address.
--------------------------------------------------------------------------
#!perl -w
use strict;
use Mail::Sendmail;
use Mac::InternetConfig;
my %mail = (
From => $InternetConfig{kICEmail()}, # get sender from IC
To => '[EMAIL PROTECTED]', # recipients go here
Subject => "MacPerl test message",
);
$mail{Message} = <<EOM;
This is the body of the message!
EOM
sendmail(%mail) or warn $Mail::Sendmail::error;
--------------------------------------------------------------------------
Or if you need to add attachments to messages you can move to MIME::Lite
--------------------------------------------------------------------------
#!perl -w
use MIME::Lite;
$message=MIME::Lite->new(
From=>'[EMAIL PROTECTED]',
To=>'[EMAIL PROTECTED]',
Subject=>'Testing an attachment',
Data=>'Stupid pdf version of mac prices'
);
$message->attach( Type=>'application/pdf',
Encoding=>'base64',
Filename=>'Ass_10.pdf',
Path=>'Macintosh HD:Desktop Folder:Teacher_UniStudent.pdf'
);
MIME::Lite->send('smtp','my.smtp.server',Timeout=>20);
$message->send;
--------------------------------------------------------------------------
Cheers,
Paul