CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
using SMTP methods...



May 4, 2000, 6:57 AM

Post #1 of 5 (1003 views)
using SMTP methods... Can't Post

I'm having difficulty getting any of the SMTP methods to work. I used the standard const. with no options, but any line after returns syntax error. I've even tried coping known good code, but get the same result. I included the library for SMTP. Anyone have an idea why this occurs?

Administrator / Moderator

May 4, 2000, 8:22 AM

Post #2 of 5 (1003 views)
Re: using SMTP methods... [In reply to] Can't Post

Could you please post your exact error, and the portion of the code using the methods?


May 4, 2000, 8:43 AM

Post #3 of 5 (1003 views)
Re: using SMTP methods... [In reply to] Can't Post

Well, I'm able to get around the syntax errors using a different approach I found in another posting on this site, but now it seems that the SMTP object can't find its constructor method, even though I can see it in the library. I just picked up Perl, so this could very easily be something simple. Also, our WebSite is hosted on an NT machine, which might cause some compatibilty issues with the Compiler/Interpretor. Thanks for the help.

use Net::SMTP;
#require "";

#The strings below which refer to corporate #URLs were replaced for the purpose of #posting.




$smtp->datasend("To: $to\n");
$smtp->datasend("From: $from\n");
$smtp->datasend("Subject: $subject\n");


print qq~
TO: $to
FROM: $from
SUBJECT: $subject


CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:

Can't locate object method "new" via package "Net::SMTP" at D:\test_sites\test


May 4, 2000, 8:48 AM

Post #4 of 5 (1003 views)
Re: using SMTP methods... [In reply to] Can't Post

Also, I caught the "debut" typo in the constructor call, and changed it to debug, but get the exact same message.

Peter Van Hoecke

May 5, 2000, 3:13 AM

Post #5 of 5 (1003 views)
Re: using SMTP methods... [In reply to] Can't Post

probeably a stupid remark, but the new constructor returns undef if it failed, so you can do "if( $smtp = Net::SMTP->new...)" to cath problems with the mailserver and so.
Every other method of Net::SMTP returns 0/1, so you can | | it. I had a lot of problems with SMTP, and by putting | | print "saomething" after it, I could chase the problem down.

Good hunting


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives