Sherm,

Thanks for your response, I have been looking at it for a day...

On Mar 2, 2004, at 7:26 PM, Sherm Pendley wrote:
On Mar 2, 2004, at 8:51 PM, Baiss Eric Magnusson wrote:

And I have SendMail installed with a line
        @EXPORT     = qw(&sendmail);
What do you mean by "have SendMail installed with"...?

That was badly put, I simply mean that when I looked into the file </Library/Perl/Sendmail.pm>, I saw the above line.


In file </Library/WebServer/CGI-Executables/cwdmail.cgi>, which is invoked by <http://www.cascadewebdesign.com/contact.html>,
<form method="post" name="entryForm" action="/cgi-bin/cwdmail.cgi">


is the line:

$err = "Error sending mail: $Mail::Sendmail::error" unless sendmail(%mail);

(Maybe there is/has been a case problem, but see below...)

When the < form method="post" > is executed, the error appears as:

cwdmail.cgi: Undefined subroutine &main::sendmail called at .../cwdmail.cgi line 29.

The Sendmail I am using is <http://alma.ch/perl/mail.htm> and is on CPAN.

I have to administer my server from afar, thus only thru <Terminal>.
Can I check these Perl scripts on my client machine ( i.e. no Apache installed) using BBEdits <Run in Terminal>?
So far, I get the same error on the client machine as I get from the server.



So now you're talking about Mail::SendMail. Is that what you meant above, when you referred to SendMail? Looking on CPAN, all I see is Mail::Sendmail - module and package names are case-sensitive, and they include all the components, not just the last word.


I'll assume you're using Mail::Sendmail. It's not an exact match to the code you've included, but it's the closest, and it exports a function called "sendmail()". Looking at the top of the perldoc page for Mail::Sendmail, I see this example:

use Mail::Sendmail;

%mail = ( To      => '[EMAIL PROTECTED]',
                From    => '[EMAIL PROTECTED]',
                Message => "This is a very short message"
        );

sendmail(%mail) or die $Mail::Sendmail::error;

print "OK. Log says:\n", $Mail::Sendmail::log;

So three suggestions:

1. Make sure you're doing "use Mail::Sendmail;" as illustrated in the example above. You're not exporting your own symbols into another package; you're importing another package's symbols into your own package, and for that you need "use", not "@EXPORT".

2. Check for misspelled and/or incomplete package names. It's "Mail::Sendmail", not "Mail::SendMail" or "SendMail".

3. You should also check out 'perldoc perlmod'. There's a *huge* amount of power to be found in CPAN, but you really do need to be able to use modules properly in order to take advantage of it.

sherm--


----
Baiss Eric Magnusson
<http://www.Track-Your-Finances.com>
<http://www.CascadeWebDesign.com>



Reply via email to