" in the Net::SMTP module"/>

"Host =>" in the Net::SMTP module

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


The following doc :

says that you can call the constructor either like this :

$smtp = Net::SMTP->new(
                            Host => 'mailhost',

or directly :

$smtp = Net::SMTP->new('mailhost', ...

(ie, without "Host =>")

But on this doc :

only the second option is documented.

On my server, and with the last version of the module, the first option
doesn't work.
Do you know why ?
Has it changed with newer versions of the module ?


Re: "Host =>" in the Net::SMTP module

Quoted text here. Click to load it

Precisely which version are you running ?
Latest version on CPAN is 1.21 and, according to the docs, the "first
option" should work fine with that version.

Quoted text here. Click to load it


I tend to expect that "the first option" should work with the most recent
versions of Net::SMTP, but perhaps not with earlier versions.

Can you check which version of Net::SMTP you are running:

perl -MNet::SMTP -e 'print $Net::SMTP::VERSION'

or, if you're on Windows:

perl -MNet::SMTP -e "print $Net::SMTP::VERSION"

Whichever version you're running, the behaviour should be as documented in
'perdoc Net::SMTP'.


Site Timeline