in reply to sending email using Email::Send

First, your example code is incorrect, because you double quote the email addresses, which makes perl try to interpolate the domain name as an array. Use q(somebody@somewhere.org) or 'somebody@somewhere.org' instead of "somebody@somewhere.org".

But your main point is correct, Email::Send does not send the SMTP command QUIT before breaking off the connection. This appears to be a bug in Email::Send (behaves the same on my system, with the latest version of Email::Send installed) and I would encourage you to file a bug report, because this behaviour is incorrect according to RFC 2821.


All dogma is stupid.

Replies are listed 'Best First'.
Re^2: sending email using Email::Send
by zdzieblo (Acolyte) on May 09, 2008 at 13:37 UTC
    yup, i should have single quoted eaddresses ... thanks for confirming it's a internal module bug...
Re^2: sending email using Email::Send
by Anonymous Monk on May 09, 2008 at 12:46 UTC
    Hmm, so
    sub DESTROY { $SMTP->quit if $SMTP; }
    doesn't get executed (?in time)?

      No, it doesn't appear to be, adding a warning statement to the DESTROY block in Email::Send::SMTP does not result in any output.

      I'm pretty sure it's not a timeout issue either, because doing a tcpdump trace of the net traffic shows the script sending a TCP FIN packet (so it's actively closing the connection, not hanging).


      All dogma is stupid.
        Making $SMTP a file scope lexical (my) would probably fix that.