×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Variable "$.." is not imported. Global symbol "$.." requir

Variable "$.." is not imported. Global symbol "$.." requir

Variable "$.." is not imported. Global symbol "$.." requir

(OP)
The original error message occurred after submiting Feedback.htm,

} else { $Mailer->AddRecipient(' , 'name1@company.com' ) ; error '80004005'
Can't call method "AddRecipient" on unblessed reference.
/feedback.asp, line 35


The original file as follow:

<%@ LANGUAGE = PerlScript%>
<html>
<body>
<table>
¡K..
</table>

<%
    $MAILHOST = company.com'; ## SMTP server for email page.
    $Mailer = $Server->CreateObject("SMTPsvg.Mailer");

    $Mailer->{'FromName'} = $Request->Form('Name')->item;
    $Mailer->{'FromAddress'} = $Request->Form('Email')->item;
    $Mailer->{'RemoteHost'} = $MAILHOST;
    $Mailer->{'Subject'} = "Comment from 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 || ! $Request->Form('Email')->item || ! $Request->Form('Comments')->item) {
        $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()) {
            $Response->write("<P><FONT Size=+1>Thank you for your comments.  They have been successfully sent.</FONT>");
        } else {
            $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>' );
        }
    }
%>
  
¡K.
</body>
</html>



The first reply I got is this:

¡§Are you sure that
$Mailer = $Server->CreateObject("SMTPsvg.Mailer");
creates an Object? You should check this. With
$Win32::OLE::Warn = 3;
every COM error is immediately reported and your script dies.
Hope that helps¡¨



Then I inserted use strict and my before variables,  and got a new error message.


} $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 45
Can you help?  Thank you.  


The revised file:

<%
 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 || ! $Request->Form('Email')->item || ! $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>");
        }
    }
%>
    

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close