Swift mailer to send large number of emails--duplicate seen
Posted: Sat May 12, 2007 11:46 am
Hi,
I'm asked to develop an application that allows user to send out newsletter. Typical user will come in and send around 3000-6000 newsletter emails each time.
I have been using Swiftmailer to implement this, each time by calling the following:
$num_sent=$swift->batchSend($message, $recipients, new Swift_Address("support@mynewsletter.com", "MyNewsletter"));
Where the number of email addresses in $recipients is 3000-6000.
I use PayPal Instant Payment Notification (IPN) to process the payment and when user has made the payment and PayPal verifies, the above line is called.
This has been working out fine, except lately when I start testing with real large number of emails. Last night I sent out a batch of about 3400 and called my hosting Godaddy, they told me more than 9000 are received by the server. I put some test display in the same file and I see the message is printed out 3 times. It almost looks like the php script file containing the above line is processed 3 times.
This doesn't happen all the time. Here are some scenarios:
1. Have not experience this when the number of emails is smaller, such as 200-300
2. Does not always repeat 3 times, I have seen 5,6,7 times
3. If I comment out the above $swift->batchSend line, then do the same experiment for 3400 emails, I do not see the message printed out multiple times. Only once. I repeated the experiment 4 times.
I know this sounds very wierdo. I haven't been able to google anything like this. Any suggestions? I'd really appreciate it.
Jenny
I'm asked to develop an application that allows user to send out newsletter. Typical user will come in and send around 3000-6000 newsletter emails each time.
I have been using Swiftmailer to implement this, each time by calling the following:
$num_sent=$swift->batchSend($message, $recipients, new Swift_Address("support@mynewsletter.com", "MyNewsletter"));
Where the number of email addresses in $recipients is 3000-6000.
I use PayPal Instant Payment Notification (IPN) to process the payment and when user has made the payment and PayPal verifies, the above line is called.
This has been working out fine, except lately when I start testing with real large number of emails. Last night I sent out a batch of about 3400 and called my hosting Godaddy, they told me more than 9000 are received by the server. I put some test display in the same file and I see the message is printed out 3 times. It almost looks like the php script file containing the above line is processed 3 times.
This doesn't happen all the time. Here are some scenarios:
1. Have not experience this when the number of emails is smaller, such as 200-300
2. Does not always repeat 3 times, I have seen 5,6,7 times
3. If I comment out the above $swift->batchSend line, then do the same experiment for 3400 emails, I do not see the message printed out multiple times. Only once. I repeated the experiment 4 times.
I know this sounds very wierdo. I haven't been able to google anything like this. Any suggestions? I'd really appreciate it.
Jenny