Front page | perl.beginners |
Postings from April 2012
Re: Net::SMTP
Thread Previous
|
Thread Next
From:
Michael Rasmussen
Date:
April 24, 2012 15:59
Subject:
Re: Net::SMTP
Message ID:
a81f61aca1b0802a8d41ea7237b85c4d@post.michaelsnet.us
On 2012-04-24 13:17, Somu wrote:
> Ok.. Thanks for the info on gmail.
> But is there any way to find out such information for other hosts?
> Like I have an account at https://ems.sbi.co.in so again how do i do
> for
> that?
You use the DNS system, usually with nslookup or dig to an mx lookup
type. MX stands for Mail eXchanger.
Examples:
$ > dig jamhome.us mx
; <<>> DiG 9.6-ESV-R4-P1 <<>> jamhome.us mx
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17630
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;jamhome.us. IN MX
;; ANSWER SECTION:
jamhome.us. 86400 IN MX 20 barn.michaelsnet.us.
jamhome.us. 86400 IN MX 10 post.michaelsnet.us.
;; Query time: 81 msec
;; SERVER: 192.168.151.40#53(192.168.151.40)
;; WHEN: Tue Apr 24 17:57:27 2012
;; MSG SIZE rcvd: 82
or
$ nslookup
> set type=mx
> jamhome.us
Server: 192.168.151.40
Address: 192.168.151.40#53
Non-authoritative answer:
jamhome.us mail exchanger = 10 post.michaelsnet.us.
jamhome.us mail exchanger = 20 barn.michaelsnet.us.
> On Tue, Apr 24, 2012 at 10:38 PM, Leo Susanto <leosusanto@gmail.com>
> wrote:
>
>> Gmail is implementing secure SMTP, so plain SMTP won't work.
>>
>> use Net::SMTP::TLS;
>>
>> And make sure you are using these information
>> Host => 'smtp.gmail.com',
>> Hello => 'gmail.com',
>> Port => 587,
>> User => 'xxx@gmail.com',
>>
>>
>> On Tue, Apr 24, 2012 at 9:57 AM, Somu <som.ctc@gmail.com> wrote:
>> > SMTP is a Protocol, which uses standard commands to send mail.
>> >
>> > I want to use it. So there is already an implementation written.
>> So I'm
>> not
>> > going for IO or Sockets..
>> > I want to make it work.
>> > Please, I need some workable parameters. Help.
>> > And it dies, simply. Don't know what goes on beneath the
>> surface...
>> >
>> >
>> > On Tue, Apr 24, 2012 at 6:26 AM, Michael Rasmussen
>> <michael@jamhome.us
>> >wrote:
>> >
>> >> 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.ctc@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
>> >>
>> >
>> >
>> >
>> > --
>> > Love,
>> > Somu,
>> > http://lose.yourself.mcommunity.biz
>> > http://fidel.castro.peperonity.com
>>
--
Michael Rasmussen
http://www.jamhome.us/
Be Appropriate && Follow Your Curiosity
Thread Previous
|
Thread Next