in reply to What's wrong with my forwarder?

I can't see anything wrong with line 29. It seems ok, according the Net::Cmd and Net::SMTP docs.

However, if you've added a couple lines since you got the error message you noted, I think it could be your statement in line 31-

close OUT;
Two things-
  1. Where do you open a filehandle called OUT? You can't close something you didn't open.
  2. Did you mean to close STDERR instead? If so, you may want to close it after the loop, as the way you have it it would close it right after deleting the message.

Also, you should have the following lines at the beginning of your code. It will catch more errors -

#!/usr/bin/perl -w use strict; use warnings;
(replace your current #!perl line with #!/usr/bin/perl -w)

-- Burvil

Replies are listed 'Best First'.
Re^2: What's wrong with my forwarder?
by Jobby (Monk) on Apr 01, 2006 at 14:40 UTC
    OK, fixed those errors but it hasn't helped any - the problen's definitely with the line
    $smtp->dataend();
    and strict/warnings doesn't catch anything else. One line test e-mails seem to get forwarded fine while longer ones are more likely to fail, if that's any help.