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

Re: [MacPerl-WebCGI] Net::SMTP



>Hi!
>
>I am getting this error when testing out the email script example in the
>book: MacPerl: Power and Ease:
>
># Can't locate Net/SMTP.pm in @INC.
>File 'eMaster:Web Pages:MacPerl:emailtest.acgi'; Line 4
># BEGIN failed--compilation aborted.
>
>My script is exactly like the one in the book on page 242-243.  Any
>suggestions to what might be the problem?
>
>Here is the script I am testing:
>#!perl
>use strict;
>use Net::SMTP;
>use Mac::InternetConfig;
>my($smtp, $email, @emails, $subject, $message);
>$smtp= Net::SMTP->new();
>$email= $InternetConfig{kICEmail()}; # my address
>@emails= 'friend@some.host.com';
>$subject = "Subject: My test message\n\n";
>$message = <<EOM;
>MacPerl sent this message. Nifty, eh?
>EOM

You have "EOM ". It should be "EOM". Remove the space at the end of the
line and try again.

>$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');
>

You can syntax check  by adding "-c" to the shebang line (first line)...

#!perl -c

David Seay
http://www.mastercall.com/g-s/



==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-webcgi-request@macperl.org