Posted on 2005-12-22 01:18:10-08 by jed
works on command line but not as cgi
acts real strange, little test program works from the command line but fails when invoked as http cgi script I get a -1 returned from the newnew Mail::Sender Software error: Can't create the Mail::Sender object: The SMTP server smtp.xxxxx.com was not found at /var/www/cgi-bin/test_mail.pl line 15 r note that all servers and email addresses have been obscured with "X"'s any ideas? ----cut here----
#! /usr/bin/perl # # use CGI::Carp qw(fatalsToBrowser); use Mail::Sender; use strict; print "Content-type: text/plain\n\nemail sent\n\n"; my $sender = new Mail::Sender {smtp => 'smtp.xxxxx.com', from => 'xxxxxx\@xxxxx.com', on_errors = +> undef} or croak "Can't create the Mail::Sender object: $Mail::Sender::Error\n";; $Mail::Sender::NO_X_MAILER = 1; $sender->MailMsg({ to => "xxxxxx\@xxxxx.com", subject => "mail test", ctype => "text/html", encoding => "7bit", msg => "more test"});
Direct Responses: 1499 | Write a response
Posted on 2005-12-22 02:08:25-08 by jed in response to 1498
Re: works on command line but not as cgi
solved, turns out to be a security feature in fedora, needed to turn on the ability for http cgi scripts to make socket connections off host
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.