Trap MX-server responses
"Jan Stapel/Vito & Associates, Inc" <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.mail-box |
|---|---|
| Message-ID | <[email protected]> |
Dear Mark,
I am using :
$sender = Mail::Transport->new(hostname => '10.0.0.61', port => '25', via
=> 'SMTP', helo =>'vitoassoc.com',
smtp_debug => 'true');
To send mail directly to the MX host.
I have turned debug on to see the response from the server.
As I understand Net::SMTP is used by Mail::Transport......via =>'SMTP'.
Below is a small script using Net::SMTP, where it looks for "550" return
codes to flag bad email address.
$smtp = Net::SMTP->new($nserver, Debug => 1, Hello => 'vitoassoc.com',
Timeout => 30);
$smtp->mail('[email protected]');
$smtp->recipient('[email protected]');
if ($smtp->code() eq "550")
{
$smtp->reset();
$smtp->quit;
$result = "bad";
}
else
{
$smtp->data();
$smtp->datasend("Subject:Test Message\n");
$smtp->datasend("From: vito\@mailherd.com\n");
$smtp->datasend("\n");
How can I incorporate this same idea in Mail::Transport?
Met Vriendelijke Groet.
Jan Stapel
Vito & Associates, Inc.
Automation Consultants
"We Keep People & Their Data Connected"
Phone: 760-318-1328
Cellular Phone: 818-266-0976
www.vitoassoc.com
www.vitoassoc.net
www.mailherd.com