Net::SMTP problem
- From: "Matt" <mda@xxxxxx>
- Date: 30 Aug 2006 12:00:09 -0700
have a simple few lines of Perl I'm trying to run from a cgi program
to send some email.
My code looks like:
use Net::SMTP;
my $email="mda\@x.com";
my $msg="hello tst\n";
$smtp = Net::SMTP->new('smtp.x.com');# or die "Unable to open
the connection";
$smtp->mail('...@xxxxxxxxx');
$smtp->to($email);
$smtp->data($msg);
$smtp->dataend();
$smtp->quit;
When I run the code via command line it works. When I run it via a cgi
program from a webpage I get when it dies on the SMTP->new line:
Can't call method "mail" on an undefined value
Everything I"ve searched for says it is because my script cannot
contact the smtp server, but that's not the case because when I run it
via the command line, it works fine.
It looks like it has to be some permisssion thing, either in sendmail
or apache.
Any thoughts?
Thanks
.
- Prev by Date: Re: Can overloaded '+' return an array? If so, how?
- Next by Date: FAQ 6.19 What good is "\G" in a regular expression?
- Previous by thread: Can overloaded '+' return an array? If so, how?
- Next by thread: FAQ 6.19 What good is "\G" in a regular expression?
- Index(es):
Relevant Pages
|