Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Net::SMTP fails connection in CGI

Reply
Thread Tools

Net::SMTP fails connection in CGI

 
 
CMCLab
Guest
Posts: n/a
 
      06-08-2004
Hello,
I'm running an IIS server on Windows 2000 with ActiveState Perl
5.8. I need an automated e-mailer that attaches a PDF file. To do so,
I'm using MIME::Lite; I need to use Net::SMTP in turn to interface with
the SMTP server. Whenever I try to instantiate the Net::SMTP object
through the CGI interface, the following error occurs:

"Failed to connect to mail server: Unknown error"

When I run the script from the command line interface, it makes the
connection fine, and sends the e-mail without problems. However in the
CGI interface, it fails. This is suggestive of a permissions problem,
but I'm unclear about which permissions I would have to change if this
was indeed the case.

The other thought I had was that going through the CGI interface changes
my identity to the mail server somehow, and it would no longer know what
domain I was from - but there is nothing in Net/SMTP.pm that I can see
that would suggest that.

I'm running out of ideas. Any thoughts?

Thanks.

--
T. Barrett

 
Reply With Quote
 
 
 
 
Matt Garrish
Guest
Posts: n/a
 
      06-08-2004

"CMCLab" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ell.edu...
> Hello,
> I'm running an IIS server on Windows 2000 with ActiveState Perl
> 5.8. I need an automated e-mailer that attaches a PDF file. To do so,
> I'm using MIME::Lite; I need to use Net::SMTP in turn to interface with
> the SMTP server. Whenever I try to instantiate the Net::SMTP object
> through the CGI interface, the following error occurs:
>
> "Failed to connect to mail server: Unknown error"
>
> When I run the script from the command line interface, it makes the
> connection fine, and sends the e-mail without problems. However in the
> CGI interface, it fails. This is suggestive of a permissions problem,
> but I'm unclear about which permissions I would have to change if this
> was indeed the case.
>


CGI processes on IIS run as the IUSR. Check that you allow anonymous access
to the smtp server (in the snap-in control). If not, enable it and the
problem should go away. It would also be a good idea to only allow messages
to be sent from the local machine once you do, though.

Matt


 
Reply With Quote
 
 
 
 
Kevin Collins
Guest
Posts: n/a
 
      06-09-2004
In article <Uesxc.32750$(E-Mail Removed)>, Matt Garrish wrote:
>
> "CMCLab" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) ell.edu...
>> Hello,
>> I'm running an IIS server on Windows 2000 with ActiveState Perl
>> 5.8. I need an automated e-mailer that attaches a PDF file. To do so,
>> I'm using MIME::Lite; I need to use Net::SMTP in turn to interface with
>> the SMTP server. Whenever I try to instantiate the Net::SMTP object
>> through the CGI interface, the following error occurs:
>>
>> "Failed to connect to mail server: Unknown error"
>>
>> When I run the script from the command line interface, it makes the
>> connection fine, and sends the e-mail without problems. However in the
>> CGI interface, it fails. This is suggestive of a permissions problem,
>> but I'm unclear about which permissions I would have to change if this
>> was indeed the case.
>>

>
> CGI processes on IIS run as the IUSR. Check that you allow anonymous access


That is not always true. You can confugure IIS to run as different IDs and it
still depends on the type of authentication being done. If NTLM auth is in
effect, CGI processes run as the authenticated use and NOT the web server
(anonymous) user.

This has burned me more than once because I am used to Apache and Unix/Linux...

> to the smtp server (in the snap-in control). If not, enable it and the
> problem should go away. It would also be a good idea to only allow messages
> to be sent from the local machine once you do, though.
>
> Matt


Kevin

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Constant.t fails 240 of 272 tests and recurs.t fails 1 of 25 tests on HPUX using perl 5.8.7 dayo Perl Misc 11 12-16-2005 09:09 PM
ICS works with wired connection, fails with wireless connection Rich Wireless Networking 0 11-16-2005 06:48 PM
slideshow fails, Firefox debugger also fails lkrubner@geocities.com Javascript 2 12-23-2004 06:22 PM
Forms Authentication Fails Between ASP.NET 1.0 and 1.1 Applications (Cookie Decryption Fails) John Saunders ASP .Net 1 11-18-2003 03:25 PM
Importing WMI module into Python CGI script fails MK Python 4 07-20-2003 08:24 PM



Advertisments