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

[MacPerl] Mailer for MacPerl



I know that this question has been asked and answered quite a few times on
this list, but all of my searches have led me in large and very frustrated
circles.

I need to send mail from a macperl cgi form.  I have used the code found
on pg 242-243 MacPerl Power and Ease (I listed it below just in case it is
only a typo)

#!perl
use strict;
use Net::SMTP;
use Mac::InternetConfig;
my($smtp, $email, @emails, $subject, $message);
$smtp = Net::SMTP->new();
$email = $InternetConfig{kICEmail ()};
@emails = 'kelfstro@piper.hamline.edu';
$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->dataend()					or warn
('failure');
$smtp->quit()								or
warn ('failure');

 and I get
# Can't call method "mail" without a package or object reference.
File 'Borges:Desktop Folder:Transfer:mail test:mailver2'; Line 13

I have InternetConfig on my computer and it should be set up correctly.
Does anyone have any sugeestions or could someone explain to me if I
should be looking for any of the following libraries that I see
mentioned on numerous macperl sites:

macSMTP.pl
macchat.pl
form2mail
Mailtools

Thanks in advance for any help to this question.

-Kiera






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