Hi, Yes, I tried the Debug=>1 option and got an error "Can't call method auth on an undefined value". When I tried to do it your way, it seems like the program hangs with the authorization part. I'm not sure why that is. My username and password are all correct. I've tried the username without the "@gmail.com" but still gives the same error. I'm wondering if I need SSL or anything for gmail. Can't seem to get my yahoo email account to work either. Maybe thats why the authorization is failing??
use MIME::Lite; use Net::SMTP; $FROM='james@gmail.com'; $TO='james@hotmail.com'; $subject='TESTING 123'; $SMTPUSER='james@gmail.com'; $SMTPPASS='james1234'; $message_text='testing'; my $msg = MIME::Lite->new(From => $FROM,To => $TO,Subject => $subject, +Type => 'multipart/alternative'); my $smtp = new Net::SMTP('smtp.gmail.com:465', Timeout => 15, Debug => + 1); $smtp->auth($SMTPUSER, $SMTPPASS); $smtp->mail($FROM); $smtp->to($TO); $smtp->data($msg->as_string); $smtp->quit;

In reply to Re^4: Sending Mail from Perl Script by Niner710
in thread Sending Mail from Perl Script by Niner710

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.