Page 1 of 1

Some of the email not sent when specifying a many recipient.

Posted: Wed Apr 11, 2007 9:01 pm
by jlising
Hello!

I have a problem in sending email. I have a script that sends an email to multiple recipients (above 100 recipients). I'm avoiding the use of bcc: or cc: field that's why I used a loop to send email using the To: field. But some of the emails were not sent. Is there an efficient way to solve this problem?

Many Thanks!

Posted: Wed Apr 11, 2007 10:35 pm
by aaronhall
Swiftmailer has some libraries to connect directly to the SMTP server to send email, which is far more efficient than mail() if your server allows for it.

Posted: Wed Apr 11, 2007 10:44 pm
by jlising
I am using a php mailer class. I don't want to start over again to avoid reconfigurations. Please give me some hints how to solve my problem.

Posted: Wed Apr 11, 2007 11:15 pm
by aaronhall
Well, if you're mailer class will connect directly to the SMTP server, give that a shot. Otherwise, you'd probably have better luck sending only a few at a time, by either setting up a cronjob or sleep()ing a few times over the course of the loop.

Posted: Thu Apr 12, 2007 1:26 am
by Chris Corbyn
PHPMailer used to just hang for me sometimes if I tried sending that many emails. Anyway, some (read, most) servers have limits on how many emails you can send in a single connection. You need to disconnect and reconnect before that limit is hit. SwiftMailer provides and anti-flood plugin for this but if you're srongly attached to PHPMailer it won't be too tricky to just track the number of emails sent in a loop. Have you checked for errors?

Posted: Thu Apr 12, 2007 1:33 am
by jlising
Hello d11wtq!

I'm totally revising my scripts and I will use the Swift Mailer. I found out this class has the method name batchsend(), unfortunately, I cannot use this method because each message I will send to each recipient is customized (e. g. the salutation Dear Mr. Lising). That means, I need to go on with the looping statement to send emails.

Is there an easiest or very efficient way to do the same aside from what I think?

Thanks!

Posted: Thu Apr 12, 2007 7:19 am
by Chris Corbyn
jlising wrote:Hello d11wtq!

I'm totally revising my scripts and I will use the Swift Mailer. I found out this class has the method name batchsend(), unfortunately, I cannot use this method because each message I will send to each recipient is customized (e. g. the salutation Dear Mr. Lising). That means, I need to go on with the looping statement to send emails.

Is there an easiest or very efficient way to do the same aside from what I think?

Thanks!
How to customize messages for each recipient in a batch

;)