andycheese
Programmer
Hi, I'm trying to use the Mail::Mailer module to send emails from a webpage (my sysadmin can't get to grips with sendmail configuration - not that I'm surprised, it looks horrific, but I digress). My script contains the following code (and includes the line use Mail::Mailer; at the top):
$mailer = Mail::Mailer->new("smtp", "$server" );
$mailer->open({ 'From' => 'My email system <email@foo.com>',
'To' => 'User <$email_addy>',
'Subject' => Subject goes here' });
print $mailer <<END_OF_MESSAGE;
Here is the email.
(Please do NOT reply to this message.)
END_OF_MESSAGE
$mailer->close();
Is this correct syntax? The error I get on the server log is:
Can't locate Mail/Mailer/smtp.pm in @INC (@INC contains: /usr/local/lib/perl5/5.
00502/sys3k /usr/local/lib/perl5/5.00502 /usr/local/lib/perl5/site_perl/5.005/sy
s3k /usr/local/lib/perl5/site_perl/5.005 .) at (eval 4) line 2.
httpd: [Tue Mar 11 11:29:54 2003] [error] [client 172.27.254.109] Premature end
of script headers: /opt/ncrhttp/cgi-bin/formtest.cgi
Now, this doesn't mean a lot to me, but I can deduce that perl is having touble finding the correct module. How is this so (if my assumption is correct?)? I downloaded it from CPAN and put it in a directory called Mail off the perl5/5.00502 directory. Please, some help would be greatly appreciated with this, as I'm a newbie to Perl and helpful, thorough advice has been a little hard to come by.
Thanks very much in advance!
$mailer = Mail::Mailer->new("smtp", "$server" );
$mailer->open({ 'From' => 'My email system <email@foo.com>',
'To' => 'User <$email_addy>',
'Subject' => Subject goes here' });
print $mailer <<END_OF_MESSAGE;
Here is the email.
(Please do NOT reply to this message.)
END_OF_MESSAGE
$mailer->close();
Is this correct syntax? The error I get on the server log is:
Can't locate Mail/Mailer/smtp.pm in @INC (@INC contains: /usr/local/lib/perl5/5.
00502/sys3k /usr/local/lib/perl5/5.00502 /usr/local/lib/perl5/site_perl/5.005/sy
s3k /usr/local/lib/perl5/site_perl/5.005 .) at (eval 4) line 2.
httpd: [Tue Mar 11 11:29:54 2003] [error] [client 172.27.254.109] Premature end
of script headers: /opt/ncrhttp/cgi-bin/formtest.cgi
Now, this doesn't mean a lot to me, but I can deduce that perl is having touble finding the correct module. How is this so (if my assumption is correct?)? I downloaded it from CPAN and put it in a directory called Mail off the perl5/5.00502 directory. Please, some help would be greatly appreciated with this, as I'm a newbie to Perl and helpful, thorough advice has been a little hard to come by.
Thanks very much in advance!