batkins has asked for the wisdom of the Perl Monks concerning the following question:
Anyway, I wrote a script that sends the mail and it works perfectly. The problem is that if the message gets sent twice from the same script, I get an error and the mail doesn't go through. I figured it might have been the rest of my code, so I isolated the mailing sub and tried again. No dice. Why would this happen?
Here's my code:
Of course, the password is blanked out. The first time this goes through perfectly. But the second time, the tail end of the Debug output reads:#!/usr/bin/perl use Net::SMTP; use strict; use warnings; for(1..2) { my $smtp = Net::SMTP->new('smtpauth.earthlink.net', Hello => 'milkbone.org', Debug => 1) or die +"death"; $smtp->auth('batkins86@earthlink.net', '***************************'); $smtp->mail('monitor@milkbone.org'); $smtp->to('test@batkins.com'); $smtp->data(); $smtp->datasend("To: postmaster\n"); $smtp->datasend("\n"); $smtp->datasend("A simple test message\n"); $smtp->dataend(); $smtp->quit; }
I'm stumped. Any ideas?Net::SMTP=GLOB(0x81b38e0)<<< 250-puffin.mail.pas.earthlink.net Hello n +ode-423a0c29.lga.onnet.us.uu.net [66.58.12.41] Net::SMTP=GLOB(0x81b38e0)<<< 250-SIZE 10485760 Net::SMTP=GLOB(0x81b38e0)<<< 250-PIPELINING Net::SMTP=GLOB(0x81b38e0)<<< 250-AUTH PLAIN LOGIN CRAM-MD5 Net::SMTP=GLOB(0x81b38e0)<<< 250-STARTTLS Net::SMTP=GLOB(0x81b38e0)<<< 250 HELP Can't locate object method "_secflags" via package "Authen::SASL::Perl +::CRAM_MD5" at /usr/lib/perl5/site_perl/5.8.0/Authen/SASL/Perl.pm lin +e 32.
You know anyone who'll debug two million lines of code for what I get this job?
- Dennis Nedry
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sending two messages thru an smtp server with authentication
by Mr. Muskrat (Canon) on Jul 11, 2003 at 15:56 UTC | |
by batkins (Chaplain) on Jul 11, 2003 at 16:37 UTC | |
by Mr. Muskrat (Canon) on Jul 11, 2003 at 16:54 UTC | |
|
Re: Sending two messages thru an smtp server with authentication
by Mr. Muskrat (Canon) on Jul 11, 2003 at 16:57 UTC | |
by batkins (Chaplain) on Jul 11, 2003 at 18:20 UTC |