Joffroi
Joffroi

Reputation: 79

Best way to loop smtpmailer email php loop

I run a website where I would like to start sending out an email newsletter to the registered users that opted in. Currently, there are about 700 users. I use a gmail account with smtpmailer to currently send all my notifications and it works well. However, when I ran my loop script to send out the personalized newsletter, the webpage with the loop eventually errors out after getting through maybe 100 users.

I didn't think this was really that heavy of a load. Should I be following a better practice for this?

My code process is essentially as follows

  1. Connect to server
  2. set_time_limit(0);
  3. While loop for all users who are subscribed
  4. Build custom message
  5. Send Email
  6. End Loop

Thanks

Upvotes: 0

Views: 167

Answers (2)

greg_diesel
greg_diesel

Reputation: 3005

This is not what your Gmail account is for. Gmail intentionally puts blocks in place to prevent this or at least de-rail your attempts.

There are many free for small account SMTP providers out there with various restrictions. http://www.SendGrid.com Send up to 400 emails a day (12,000 emails a month) http://www.MailChimp.com Send 12,000 emails a month to a list of up to 2,000 subscribers

Those are two of the big ones but there are plenty of smaller outfits as well.

Upvotes: 2

Aminu Bakori
Aminu Bakori

Reputation: 51

Gmail allows you to send only 50 mails per hour.

Upvotes: -1

Related Questions