Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re:x2 Sending SMTP mail on other than port 25

by grinder (Bishop)
on Apr 26, 2002 at 12:51 UTC ( [id://162261]=note: print w/replies, xml ) Need Help??


in reply to Re: Sending SMTP mail on other than port 25
in thread Sending SMTP mail on other than port 25

ok, so I have the solution and I'm pleased to say that it works. Next time I'll try to remember to RTFS.

It makes me think, though, that the interface is slightly broken. To construct an object of the class correctly, it needs to pass a named attribute X to a base class. You can't, however, pass the X attribute to the new() method directly, only X2 is allowed.

I read the Net::SMTP pod, and no mention is made of the Port attribute (which is sort of to be expected). So from there I followed the chain of pod to Net::Cmd, IO::Handle, IO::Socket and IO::Socket::INET, which is where I finally found a mention a mention of PeerPort. In the first instance I was using Peer_Port, which didn't work, so when I came across this, I was sure it would work.

So what really needs to happen is the line PeerPort => $arg{Port} || 'smtp(25)',

...needs to be written as...

PeerPort => $arg{PeerPort} || $arg{Port} || 'smtp(25)',

and that way it will work regardless. I'll see what gbarr think about this :)


print@_{sort keys %_},$/if%_=split//,'= & *a?b:e\f/h^h!j+n,o@o;r$s-t%t#u'

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://162261]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (None)
    As of 2024-04-25 00:02 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found