Hi, something seems wrong with using using port 25 for TLS(SSL) connection. You can google for it yourself, but the port used for GMAIL SSL is port 465 or 587. You seem to be trying to connect to the standard mail port, and authentication fails.

Here is a simple script to show you how a SSL connection is done, I know this works, but it's a different module.

#!/usr/bin/perl use warnings; use strict; use Net::SMTP::SSL; + # Implements the same API as Net::SMTP, but uses IO::Socket::SSL for i +ts # network operations. Due to the nature of "Net::SMTP"'s "new" method, + it # is not overridden to make use of a default port for the SMTPS servic +e. # Perhaps future versions will be smart like that. Port 465 is usually + # what you want, and it's not a pain to specify that. my $user = 'me@gmail.com'; my $pass = 'yeah_for_google'; #$server = 'your-smtp-server'; my $server = 'smtp.gmail.com'; my $to = 'me@gmail.com'; my $from_email = 'me@gmail.com'; my $subject = 'smtp-ssl-auth test'; my $smtps = Net::SMTP::SSL->new($server, Port => 465, DEBUG => 1, ) or warn "$!\n"; # I hust lucked out and this worked defined ($smtps->auth($user, $pass)) or die "Can't authenticate: $!\n"; $smtps->mail("$from_email\n"); $smtps->to("$to\n"); $smtps->data(); $smtps->datasend("From: $user\n"); $smtps->datasend("To: $to\n"); $smtps->datasend("Subject: $subject\n"); $smtps->datasend("Reply-To: $from_email\n"); $smtps->datasend("MIME-Version: 1.0\n"); $smtps->datasend("Content-Type: text/plain\n"); $smtps->datasend("\n"); $smtps->datasend("This will be the body of the message.\n"); $smtps->datasend("\n--\nVery Official Looking .sig here\n"); $smtps->datasend("\n"); $smtps->dataend(); #$smtps->quit(); print "done\n"; #You can alternatively just put everything in the argument to $smtp->d +ata(), #and forget about datasend() and dataend();

I'm not really a human, but I play one on earth. ..... an animated JAPH

In reply to Re: Email::Send::SMTP::Gmail issue by zentara
in thread Email::Send::SMTP::Gmail issue by flieckster

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.