in reply to Gmail Send problem

$mail will never return anything.

Maybe $mail->send returns something, but you never store the result of that function call.

Also note that more likely, Google blocks your mails after the first 10 or so, as you might be a spammer.

Replies are listed 'Best First'.
Re^2: Gmail Send problem
by IvanH (Acolyte) on Sep 17, 2014 at 18:59 UTC

    As far as I can tell from Google's documentation they block after 500, and disable the email account for a day. I sent much less than that and the account wasn't blocked so I don't think that's the problem. How would I know if $mail->send failed for some reason.

    Thanks

      The Email::Send::SMTP::Gmail POD says you can use -verbose. When the documentation is inadequate, you should look at the source code, which shows that "send" can return a list. Try:
      my @returns = $mail->send(-to=>"$email", -subject=>"$subject", -body=>"$emailtext",-contenttype=>'text/html' -verbose=>1); print "@returns\n";