Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^4: Net::SMTP::SSL ACK!!

by hippo (Bishop)
on Feb 02, 2016 at 17:48 UTC ( [id://1154293]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Net::SMTP::SSL ACK!!
in thread Net::SMTP::SSL ACK!!

Yes, I know Net::SMTPS is also old and deprecated

AFAICT Net::SMTPS is neither old nor deprecated. Perhaps you are confusing it with something else?

Replies are listed 'Best First'.
Re^5: Net::SMTP::SSL ACK!!
by Dandello (Monk) on Feb 02, 2016 at 18:33 UTC

    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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1154293]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-24 08:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found