Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to send email from my gmail acount with Net::SMTP and I get this error in debug mode: 530 5.7.0 Must issue a STARTTLS command... Can Net::SMTP even handle this TLS stuff? Is there a better module to send email with? Thanks! -Shawn

Replies are listed 'Best First'.
Re: Net::SMTP and TLS Problems!
by jesuashok (Curate) on Nov 02, 2005 at 05:38 UTC
    Hi,

    Net::SMTP can handle TLS Stuffs also.

    you can also increase the log level upto 14 in Net::SMTP module and you can get more detail on STARTTLS command mode.

    use Mail::Sendmail; %mail = ( To => 'you@there.com', From => 'me@here.com', Message => "This is a very short message" ); sendmail(%mail) or die $Mail::Sendmail::error; print "OK. Log says:\n", $Mail::Sendmail::log;
    you can use the above module to send mail.

    That is the platform independant mail module.

    "Keep pouring your ideas"
      I tried again and couldn't figure out how to make Net::SMTP do TLS. Isn't that some sort of encryption? In the module it says:
      # We dont support sasl mechanisms that encrypt the socket traffic. # todo that we would really need to change the ISA hierarchy # so we dont inherit from IO::Socket, but instead hold it in an at +tribute

        jesuashok is wrong, neither Net::SMTP nor Mail::Sender support STARTTLS. Net::ESMTP says it does, but I've never used this module, so can't say how well it works.

        SASL and TLS are two very different things. SASL implements secure authentication over insecure channels (e.g. via Digest-MD5 passwords), whereas TLS encrypts an entire network transaction with SSL.


        Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian W. Kernighan