perl-asp mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Chamas <j...@chamas.com>
Subject Re: Mailing from the ASP Page.
Date Wed, 18 Jun 2003 06:56:10 GMT

This might be a bug in how Apache::ASP uses Net::SMTP for the $Server->Mail
API.  I am not sure why it would be breaking for you know, but I can look
into it.  Maybe this has to do with a newer version of Net::SMTP I suspect.

Until this is fixed in Apache::ASP, you can just use the Net::SMTP API directly,
so don't bother with the $Server->Mail API for now.  I'll contact you when
I know more about the $Server->Mail problem.

Regards,

Josh

pkunal wrote:
> I tried exactly what you suggested and I modified my asp page too. It 
> is now like this:
> *************************************************
> 
> <html>
> <body>
> 
> Mail sending Trial
> 
> <%
> use Net::SMTP;
> use Net::Config;  
> %>
> 
> <%
> %myMail = (
>                To => 'myself@hotmail.com',
>                From => 'pkunal@yahoo.com',
>                Subject => 'Subject of Email',
>                Body => 'Body of message. You might have a lot to say 
> here!',
>                Organization => 'Your Organization',
>                CC => 'pkunal@yahoo.com',
>                BCC => 'pkunal@yahoo.com',
>                Debug => 0 || 1,
>           );
> 
> $Server->Mail(\%myMail);
> 
> 
> foreach $key (keys %myMail)
> 
> {
> %>
> <%=$myMail{$key}%>
> <br>
> <% }%>
> 
> Mail sent.
> </body>
> </html>
> 
> *************************************************
> 
> I put in the "PerlSetVar Debug -1" and checked the error_log file.
> 
> The error message is:
> 
> [Tue Jun 17 17:27:43 2003] [error] [asp] [309937] [error] Can't use 
> string ("localhost") as an ARRAY ref while "strict refs" in use at 
> C:/Perl/site/lib//Net/SMTP.pm line 33. <--> , 
> C:/Perl/site/lib/Apache/ASP.pm line 1491
> 
> 
> I checked line 33 of SMTP.pm:
> 
> sub new
> {
>  my $self = shift;
>  my $type = ref($self) || $self;
>  my $host = shift if @_ % 2;
>  my %arg  = @_; 
>  my $hosts = defined $host ? [ $host ] : $NetConfig{smtp_hosts};
>  my $obj;
> 
>  my $h;
>  foreach $h (@{$hosts})   <<<<<<<<<<<<<<<<<<<<<<<<
Line 33
>   {
>    $obj = $type->SUPER::new(PeerAddr => ($host = $h), 
> 			    PeerPort => $arg{Port} || 'smtp(25)',
> 			    LocalAddr => $arg{LocalAddr},
> 			    LocalPort => $arg{LocalPort},
> 			    Proto    => 'tcp',
> 			    Timeout  => defined $arg{Timeout}
> 						? $arg{Timeout}
> 						: 120
> 			   ) and last;
>   }
> 
> 
> I have no clue as to whats wrong.....certainly looks like I am 
> missing something to set in my ASP Page related to SMTP server.
> 
> Please assist with this.
> 
> Thanks,
> Kunal Parekh.
> 
> 
> 
> 
> --- In apache-asp@yahoogroups.com, Josh Chamas <josh@c...> wrote:
> 
>>pkunal wrote:
>>
>>>All,
>>>
>>>After lot of consideration and confusion I have decided to go for 
>>>mailing using the Apache::ASP object $Server->Mail
>>>
>>
>>Try setting "PerlSetVar Debug -1", and see what is in your error_log
>>when the email is attempted.  Its likely that you do not have a SMTP
>>server running on localhost, and you need to have MailHost config
>>pointed to a working SMTP server.
>>
>>Regards,
>>
>>Josh
>>________________________________________________________________
>>Josh Chamas, Founder                   phone:925-552-0128
>>Chamas Enterprises Inc.                http://www.chamas.com
>>NodeWorks Link Checking                http://www.nodeworks.com
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Mime
View raw message