-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple emails sent #427
Comments
It's most likely that the script is simply being run twice. You will be able to tell if the duplicate messages have different message ID headers. Try enabling debug output ( You should probably not adding |
Thanks for the replay @Synchro, this not happening for all users, we send 1k mails only two or three users are complaining. |
For that kind of problem you just need to do lots of logging, then you will be able to go back and see what happened when you get another report. |
Ok, I will do that. |
I'm also getting this issue even when sending to just one recipient. I've added a random number to the subject field and both received messages show the same random number so as mentioned earlier in this thread they are true duplicates. |
Like I said, log everything. Run it in a debugger, record traces. All will be revealed. |
I have a similar issue, and i use the latest PHPmailer version. |
So follow the advice in this ticket. |
I've done a lot of checks and logging out apache logs... Let's say that the code is at thanks.php Of course the code of that php file, doesn't have any loop in order to do that, and also the strange thing that this this is not happening every time, but sometimes. The result of it, is the same receiver to receive more than 2-3 copies of the same email... |
It's very common for browser extensions to repeat requests. PHPMailer just doesn't have a mechanism for sending multiple messages without being asked to. Did you try the random subject test described above? That will prove whether it's multiple requests. You will also see it in your web server logs. |
I am having the same issues. PHPMailer sends sometime two or more emails. But it's done randomly as we are sending 1000+ emails daily. So it's sending after we start to send more emails. It's working fine when we send 200-300 emails a day but if we start to send more it's sending 2-3 emails to some customers. |
So do what it says above. Log details. |
Thanks Synchro for quick followup. $mail->clearAddresses fixed my issue. Thank you again. |
I thought I had the same issue until I realised that if you want to send 2 (or more) separate emails to different addresses you need to clear addresses and attachments (and everything that has clear functions). The problem that it is not obvious. I found that you have those clear functions only in that issue after an hour of trying to figure out why is that happening. I am not sure that I have to read all the documentation and all the functions available just to do the basic action - send email. |
It is mentioned in the examples, in exactly the one you'd expect - the mailing list. There's also a clue in the name it's addAddress not setAddress, implying it's cumulative. |
I am using this script for my email campaigns, users are complaining that they are receiving duplicate mails at the same point of time. I am running this script from the command line.
This is the code am using, please suggest me if there are any changes.
Thanks,
Varma
The text was updated successfully, but these errors were encountered: