M
Matt
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('(e-mail address removed)');
$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
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('(e-mail address removed)');
$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