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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Can't call method "AddRecipient" on unblessed reference.

 



huareu
Deleted

Oct 13, 2000, 6:17 AM

Post #1 of 1 (446 views)
Can't call method "AddRecipient" on unblessed reference. Can't Post

I got the following reported error after executing the code on the bottom. Please help. Thanks.
Hu


} $Response->writeblock(1); error '80004005'
Variable "$Response" is not imported. Global symbol "$Response" requires explicit package name at (eval 10) line 28.
/feedback.asp, line 52

<%@ LANGUAGE = PerlScript%>
<html>
<head>
<title>Feedback Page</title>
</head>

<BODY>
<TABLE>
</TABLE>

<%
use strict;
$Win32::OLE::Warn=3;

my $MAILHOST = 'company.com';## SMTP server for email page.
my $Mailer = my $Server->CreateObject("SMTPsvg.Mailer");
$Mailer->{'FromName'} = my $Request->Form('Name')->item;
$Mailer->{'FromAddress'} = $Request->Form('Email')->item;
$Mailer->{'RemoteHost'} = $MAILHOST;
$Mailer->{'Subject'} = "Comment from PWD Feedback Page";
$Mailer->{'BodyText'} = "Company / Institution: " . $Request->Form('Company')->item . "\n" .
"Telephone Number: " . $Request->Form('Telephone')->item . "\n" .
"Sender IP Address: " . $Request->ServerVariables('REMOTE_ADDR')->item . "\n\n\n" .
$Request->Form('Comments')->item;

if (! $Request->Form('Name')->item &#0124; &#0124; ! $Request->Form('Email')->item &#0124; &#0124; ! $Request->Form('Comments')->item) {
my $Response->write("<BR>Error! You must fill in the Name, Email, and Comments fields. Press the back button on your browser to return to the form.<BR>");
} else {
$Mailer->AddRecipient('' , 'name1@company.com') ;
$Mailer->AddRecipient('' , 'name2@company.com') ;
$Mailer->AddRecipient('' , 'name3@company.com') ;
if ($Mailer->SendMail()) {
my $Response->write("<P><FONT Size=+1>Thank you for your comments. They have been successfully sent.</FONT>");
} else {
my $Response->write("<P><FONT Size=+1>An Error has occurred. Your comments have not been successfully sent.<BR>
<a href="mailto:name2@company.com">Try clicking here to invoke your local mail program
to E-mail name2@company.com </a></FONT>");
}
}
%>

 
 


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

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