开发者

How to send bulk email with timer?

Let's say I have 200 users in my database and currently host o开发者_如何转开发n shared hosting. I want to send a newsletter to them and send only 10 emails every 5 minutes.

I'll send the newsletter using phpmailer. Questions..

  • What is the good concept to send a newsletter using existing database without export it to 3rd party services?
  • What is the key to make sure script will not send duplicate newsletter in same time?
  • What is the good practice to achieve my goal.

Let me know


You should just use a 3d party service with a good API. It will be much less work in the long run.

You haven't thought about bounce handling, unsubscribe, domain keys, avoiding blacklists and more.

At best your messages will end up in the junk mail box.

At worse your IP will be banned and your account terminated for sending unsolicted email (Your ISP won't care if they actually signed up for it).


Set up a task to select a fixed number of un-sent newsletters from the database (I would either delete sent newsletters or mark them as sent, or move them to another table). In your case you're obviously wanting to send 10 every 5 minutes, so set the task to fetch 10 emails, and send them. Then set up a cron and have it run every five minutes... There's probably a more elegant solution though if you're only ever planning on sending out the emails once / twice a week. You could do some while loops with a sleep command but thats not particularly resource efficient.... I would just go with the above - its probably the most flexible brute force solution, and your host won't really notice as it'll still be relatively quick.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜