sending email with Net::SMTP::SSL -- help needed

[email protected] ("Kamil")
Newsgroups perl.cpan.discuss
Organization http://groups.google.com
Message-ID <[email protected]>
Hi, I am new to perl, and dont know much about CPAN and modules... What
am I doing wrong in the Net::SMTP::SSL constructor?!

This works fine:

my $smtp_port=465;
my $smtp = Net::SMTP::SSL->new(Host => "smtp.gmail.com", Port =>
$smtp_port);
die "Couldn't connect to server" unless $smtp;


But, this does NOT work:

my $smtp_port=465;
my $smtp_server="smtp.google.com";
my $smtp = Net::SMTP::SSL->new(Host => $smtp_server, Port =>
$smtp_port);
die "Couldn't connect to server" unless $smtp;


Error:

Couldn't connect to server at ./process_sweep.pl line 1298.


The documentation says:

Host - SMTP host to connect to. It may be a single scalar, as defined
for the PeerAddr option in IO::Socket::INET, or a reference to an array
with hosts to try in turn. The "host" method will return the value
which was used to connect to the host.


I have tried using:

my $smtp_port=465;
my @smtp_server;
push(@smtp_server,"smtp.google.com");
my $smtp = Net::SMTP::SSL->new(Host => \@smtp_server, Port =>
$smtp_port);
die "Couldn't connect to server" unless $smtp;


But this doesn't work either...
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.