http://qs321.pair.com?node_id=1100949


in reply to Gmail Send problem

You might want to look at the documentation for the module as you've made a couple of bad assumptions. $mail is never going to equal -1.

The symptoms you are describing sound more like throttling on the GMail side. I know Yahoo throttles and I'd not be surprised if Google did as well.


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; Blog: http://blog.berghold.net Warning: No political correctness allowed.

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

    I don't think it's Gmail blocking as their documentation says they limit at 500/day, which is much more than I sent. Is there a way to know if $mail->send failed for some reason?

    Thanks

      By "throttling", blue_cowdawg did not mean blocking, but rather limiting the rate at which new messages can be sent

      You might consider adding a sleep(1) in your loop.

      Also, maybe you should consider using a list service. You send your message to the service, then it forwards it to the list subscribers.

      Since you are already using Google, Google Groups is one list service to consider. In my (limited) experience of subscribing to Google Groups, subscribers don't have to have a Google account to do so (assuming it hasn't changed since the last time I used a non-Google account with a Google Group).

        Thanks to all for the help. I seem to have things under control now. You guys were right that Google is apparently rejecting the messages, but it seems to be after about 90, which is sufficient for my purposes. $mail->send does return a single value in a list variable which appears to be 1 for success and -1 for failure, so looking at that lets me know where the block begins.