Reputation: 23749
I have a Perl script for sending Emails:
#!/usr/bin/perl
use strict;
use warnings;
use Email::Sender::Simple qw(sendmail);
use Email::Sender::Transport::SMTP ();
use Email::Simple ();
use Email::Simple::Creator ();
my $smtpserver = 'server.com';
my $smtpport = 2525;
my $smtpuser = '[email protected]';
my $smtppassword = 'secret';
my $transport = Email::Sender::Transport::SMTP->new({
host => $smtpserver,
port => $smtpport,
sasl_username => $smtpuser,
sasl_password => $smtppassword,
debug => 1,
});
my $email = Email::Simple->create(
header => [
To => '[email protected]',
From => "User name <$smtpuser>",
Subject => 'Hello',
],
body => "This is my message\n",
);
sendmail($email, { transport => $transport });
It works on one server. But on another the script freezes. Debug messages are:
Net::SMTP>>> Net::SMTP(2.31)
Net::SMTP>>> Net::Cmd(2.29)
Net::SMTP>>> Exporter(5.63)
Net::SMTP>>> IO::Socket::INET(1.31)
Net::SMTP>>> IO::Socket(1.31)
Net::SMTP>>> IO::Handle(1.28)
What's wrong? How to debug?
Upvotes: 0
Views: 172
Reputation: 123461
This happens if the TCP connection to the server was successfully established but the server does not send the expected SMTP greeting back. This can have several reasons, like:
I would suggest you look at the configuration of the server to see what is actually is expected.
Upvotes: 2