On Tue, Apr 24, 2012 at 01:54:15AM +0530, Somu wrote:
> Hi everyone...
> Why isn't it happeing!!??
> 
> Just the code from Net::SMTP docs
> 
> __________________________________________________________
> 
> use strict;
> use warnings;
> use Net::SMTP;
> 
> #these 3 lines bring the output mx.google.com
> # my $smtp = Net::SMTP->new('smtp.gmail.com') or die $!;
> # print $smtp->domain,"\n";
> # $smtp->quit;
> 
> 
> 
> #but for this...
>     my $smtp = Net::SMTP->new('smtp.gmail.com') or die $!;
> 
>     $smtp->mail('som....@gmail.com') or die $!;    #it dies here. No errors.

Does it die or does it hang?
When I tried this, modified to connect to a bogus host, the program hung at 
this point.
Editing to use a legitmate host it ran fine.

> And how are we going to know any mailhost's address???

most programs/people ask the DNS system to return the mail host for any given 
domain.

> Its irritating when you fail on the first step.

Yes it's irritating. What is your  objective?  To learn about SMTP and Perl or 
to 
just send some mail?

If "just send some mail" consider using Mail::Sender or Mail::SendEasy. 

-- 
            Michael Rasmussen, Portland Oregon  
      Other Adventures: http://www.jamhome.us/ or http://westy.saunter.us/
Fortune Cookie Fortune du courrier:
> Linux is not user-friendly.
It _is_ user-friendly.  It is not ignorant-friendly and idiot-friendly.
                ~ Seen somewhere on the net

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to