PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
like I have this database with users and their e-mails, and every now and then i have to send them some mails (one-by-one). The problem is that there are 3 mails delivered to each user (sometimes 2 or 4). I think it could be because of the great amount of e-mails (if I send one or two e-mails everything is ok). Could anyone suggest a solution to this problem?
Syranide wrote:but in the first place, how could there be multiple of the same in the database?
there is no multiple data in the database. For a minute I thought that the problem could be related to multiple e-mail output from database, but I checked it and I can assure that every mail is sent only once (at least with the function mail()).
something is apparently wrong with what you do, because to my knowledge mails don't send themselves (just as apples don't eat themselves).
I bet you are executing the entire scripts multiple times if you are sure that you are not sending more than 1 mail.
eitherway from what you've said, there is nothing we can help you with, post more code or explain much more indepth of where or what you think goes wrong and how you do it.
well... I think that the problem is that there are some 1000 or more e-mails to be sent. I think that when the server has to send 1000 e-mails one after another, the server just chokes. Maybe function usleep() would help? So the server can relax after every sent mail.
CoderGoblin wrote:It is often the case in situations like this where, as nothing is shown on the screen, a user presses reload, starting the mail run again.