I was under the impression that the SSL support in Net::SMTP had made it redundant. However, I do know that Net::SMTPS works for my app and the documentation for using Net::SMTP only for TLS connection is sorely lacking.

BTW, the current Net:SMTP code looks like:

#!/usr/bin/perl use strict; use warnings; use IO::Socket::SSL qw(debug3); use Net::SMTP; use CGI::Carp qw(fatalsToBrowser); use English '-no_match_vars'; our @ARGV = ( 'mygmail@gmail.com', 'mypassword', 'touser@forumsoftware +.com', 'mygmail@gmail.com' ); my $body = "Test message"; my $headers = "Content-Type: text/plain\r\n\r\n"; my $smtp_server = 'smtp.gmail.com'; my $port = 587; my $mailer = new Net::SMTP( $smtp_server, Hello => 'host.domain.net', Port => $port, Debug => 1, User => $ARGV[0], Password => $ARGV[1], ) || die "Unable to create Net::SMTP object. Server: '$smtp_server +', port '$port'\n\n" . $OS_ERROR; $mailer->auth($ARGV[0], $ARGV[1]); $mailer->mail($ARGV[3]); $mailer->to($ARGV[2]); $mailer->data(); $mailer->datasend("Subject: Net::SMTP test\r\n\r\n" . $headers . $body +); $mailer->dataend; $mailer->quit; print "Content-type: text/html\n\n" or croak 'cannot print line1'; print "Complete"; exit();

gets this from the debug trace:

Net::SMTP>>> Net::SMTP(2.31) Net::SMTP>>> Net::Cmd(2.29) Net::SMTP>>> Exporter(5.58) Net::SMTP>>> IO::Socket::INET(1.29) Net::SMTP>>> IO::Socket(1.29) Net::SMTP>>> IO::Handle(1.25) Net::SMTP=GLOB(0x97fc844)<<< 220 smtp.gmail.com ESMTP 89sm4313614pfi.2 + - gsmtp Net::SMTP=GLOB(0x97fc844)>>> EHLO host.domain.net Net::SMTP=GLOB(0x97fc844)<<< 250-smtp.gmail.com at your service, [67.2 +22.16.122] Net::SMTP=GLOB(0x97fc844)<<< 250-SIZE 35882577 Net::SMTP=GLOB(0x97fc844)<<< 250-8BITMIME Net::SMTP=GLOB(0x97fc844)<<< 250-STARTTLS Net::SMTP=GLOB(0x97fc844)<<< 250-ENHANCEDSTATUSCODES Net::SMTP=GLOB(0x97fc844)<<< 250-PIPELINING Net::SMTP=GLOB(0x97fc844)<<< 250-CHUNKING Net::SMTP=GLOB(0x97fc844)<<< 250 SMTPUTF8 Net::SMTP=GLOB(0x97fc844)>>> MAIL FROM:<mygmail@gmail.com> Net::SMTP=GLOB(0x97fc844)<<< 530 5.7.0 Must issue a STARTTLS command f +irst. 89sm4313614pfi.2 - gsmtp

I think this indicates that STARTTLS started, but something happened.

More: The Net::SMTP on my production server is 2.31. Therefore Net::SMTPS it is. That said, it would be nice if someone would put together a tutorial explaining all this for people suffering through trying to get this to work as advertised.


In reply to Re^5: Net::SMTP::SSL ACK!! by Dandello
in thread Net::SMTP::SSL ACK!! by Dandello

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.