I set up a loop to send it to about 150 addresses. I know that the first few went successfully and the last few did not
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.