Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Error using SMTP object.

Reply
Thread Tools

Error using SMTP object.

 
 
pgmrdan
Guest
Posts: n/a
 
      12-01-2007
I'm getting the following message -

Can't call method "domain" on an undefined value at domain.pl line 4.

When trying to execute the following -

use Net::SMTP;

$smtp = Net::SMTP->new('xxxxxxxxxx.xxx');
print $smtp->domain,"\n";
$smtp->quit;

I'm using my ISP provider in place of the x's.

What am I doing wrong?

Thanks.


 
Reply With Quote
 
 
 
 
pgmrdan
Guest
Posts: n/a
 
      12-01-2007
Never mind. I had the wrong SMTP server name. It works now.

Thanks.

"pgmrdan" <(E-Mail Removed)> wrote in message
news:fiqb57$83p$(E-Mail Removed)...
> I'm getting the following message -
>
> Can't call method "domain" on an undefined value at domain.pl line 4.
>
> When trying to execute the following -
>
> use Net::SMTP;
>
> $smtp = Net::SMTP->new('xxxxxxxxxx.xxx');
> print $smtp->domain,"\n";
> $smtp->quit;
>
> I'm using my ISP provider in place of the x's.
>
> What am I doing wrong?
>
> Thanks.
>
>



 
Reply With Quote
 
 
 
 
Martijn Lievaart
Guest
Posts: n/a
 
      12-01-2007
On Fri, 30 Nov 2007 19:41:05 -0600, pgmrdan wrote:

> Never mind. I had the wrong SMTP server name. It works now.


Yes, but....

> "pgmrdan" <(E-Mail Removed)> wrote in message
> news:fiqb57$83p$(E-Mail Removed)...
>> I'm getting the following message -
>>
>> Can't call method "domain" on an undefined value at domain.pl line 4.
>>
>> When trying to execute the following -
>>
>> use Net::SMTP;
>>
>> $smtp = Net::SMTP->new('xxxxxxxxxx.xxx');


You never test for success here.

$smtp = Net::SMTP->new('xxxxxxxxxx.xxx') or die "<insert suitable
message>";

>> print $smtp->domain,"\n";
>> $smtp->quit;


HTH,
M4
 
Reply With Quote
 
pgmrdan
Guest
Posts: n/a
 
      12-02-2007
Good point! Thank you.


"Martijn Lievaart" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> On Fri, 30 Nov 2007 19:41:05 -0600, pgmrdan wrote:
>
> > Never mind. I had the wrong SMTP server name. It works now.

>
> Yes, but....
>
> > "pgmrdan" <(E-Mail Removed)> wrote in message
> > news:fiqb57$83p$(E-Mail Removed)...
> >> I'm getting the following message -
> >>
> >> Can't call method "domain" on an undefined value at domain.pl line 4.
> >>
> >> When trying to execute the following -
> >>
> >> use Net::SMTP;
> >>
> >> $smtp = Net::SMTP->new('xxxxxxxxxx.xxx');

>
> You never test for success here.
>
> $smtp = Net::SMTP->new('xxxxxxxxxx.xxx') or die "<insert suitable
> message>";
>
> >> print $smtp->domain,"\n";
> >> $smtp->quit;

>
> HTH,
> M4



 
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
SMTP Relay from IIS SMTP Virtual Server tshad ASP .Net 1 05-05-2008 04:26 AM
Sending SMTP mail when SMTP server is unavailable matthewjbarr@gmail.com Java 3 01-24-2006 06:53 PM
smtplib.SMTP "no attributes SMTP" Copelandia Cyanescens Python 2 07-31-2004 07:24 PM
sending of mail (smtp) - connection refused - but smtp server isrunning! Alex Hunsley Python 4 06-29-2004 04:30 PM
RE: sending of mail (smtp) - connection refused - but smtp serveris running! Raaijmakers, Vincent \(GE Infrastructure\) Python 0 06-29-2004 02:38 PM



Advertisments