[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Email & CGIs



I've been trying to get MacPerl to send mail for some time now, but always seem to come unstuck. After following the directions kindly provided by Andy in the preceding e-mail, the following script passes the syntax check:

--------------------------------------------------------
use Mail::Mailer;

$from_address = 'SeanC@mediatek.co.za';
$to_address = 'SeanC@mediatek.co.za';
$subject = "MacPerl and MailTools";
$body = <<END_OF_BODY;
    This email message is being sent by MacPerl.
    MacPerl is using the MailTools libraries to send it.
    Pretty cool, huh?
END_OF_BODY

$mailer = Mail::Mailer->new();
$mailer->open({ From    => $from_address,
                To      => $to_address,
                Subject => $subject,
 })
 or die "Can't open: $!\n";
print $mailer $body;
$mailer->close();
--------------------------------------------------------

but then aborts with the following error:

--------------------------------------------------------
# Can't locate Net/SMTP.pm in @INC.
File 'Toadwart:Applications:MacPerl Ä:site_perl:Mail:Mailer:smtp.pm'; Line 3
# BEGIN failed--compilation aborted.
File 'Toadwart:Applications:MacPerl Ä:site_perl:Mail:Mailer:smtp.pm'; Line 3
--------------------------------------------------------


If I replace the MacPerl Ä:lib:Net folder with the one in CPAN on the MacPerl disk, which seems to contain a more complete set of modules, the error changes to:

--------------------------------------------------------
# Can't locate Net/Config.pm in @INC.
File 'Toadwart:Applications:MacPerl Ä:lib:Net:SMTP.pm'; Line 17
# BEGIN failed--compilation aborted.
File 'Toadwart:Applications:MacPerl Ä:lib:Net:SMTP.pm'; Line 17
# BEGIN failed--compilation aborted.
File 'Toadwart:Applications:MacPerl Ä:site_perl:Mail:Mailer:smtp.pm'; Line 3
--------------------------------------------------------


I've also unsuccessfully tried to use the example in _MPPE_ pp. 242-3:

--------------------------------------------------------
#!perl -w
use strict;
use site_perl::Net::SMTP;
use Mac::InternetConfig;
my($smtp, $email, @emails, $subject, $message);
$smtp = Net::SMTP->new();
$email = $InternetConfig{kICEmail()};
@emails = 'seanc@mediatek.co.za';
$subject = "Subject: My test message\n\n";
$message = <<EOM;
MacPerl sent this message.
EOM

$smtp->mail($email)  or warn('failure');
$smtp->to(@emails)    or warn('failure');
$smtp->data()         or warn('failure');
$smtp->datasend($subject) or warn('failure');
$smtp->datasend($message) or warn('failure');
$smtp->datasend()     or warn('failure');
$smtp->quit()         or warn('failure');
--------------------------------------------------------

This one fails the syntax check with the following error:

--------------------------------------------------------
# Can't locate site_perl/Net/SMTP.pm in @INC.
File '<AppleEvent>'; Line 6
# BEGIN failed--compilation aborted.
File '<AppleEvent>'; Line 6
--------------------------------------------------------


What am I doing wrong? I've tried reinstalling MacPerl and I'm pretty sure I followed the directions right: install 'Mac_Perl_520r4_appl' then 'Mac_Perl_520r4_bigappl' ontop.

Any ideas? Please ...

My brain hurts!
SeanC
                     Mediatek Training Institute
   1st Floor Media Park, 129 Moore Road, Berea, Durban, South Africa
   phone: +27 (0)31 305 4200              SeanC@mediatek.co.za
   fax: +27 (0)31 305 4236                Mediatek@global.co.za


***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch