Too many emails in one go perhaps? - how to fix sendmail?

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
tata668
Forum Newbie
Posts: 3
Joined: Mon Feb 16, 2009 11:13 am

Too many emails in one go perhaps? - how to fix sendmail?

Post by tata668 »

Hi,

I had to send +/- 100 emails. I did it with a 5 seconds pause between each email. But even then, at one point, I received this error:

-----
Unable to send email : !There was a problem reading line 1 of an SMTP response. The response so far was:
[]. It appears the connection has died without saying goodbye to us! Too many emails in one go perhaps? (fsockopen: #0)
-----

I know there are some plugins to help fix this problem in SwiftMailer (AntiFlood and Throttler), but since I'm on a dedicated server and have access to sendmail configuration, I would prefere to change sendmail instead of using a plugin. Can someone points me to any help on how to change sendmail configuration so I don't have this emails/minutes limit? I have no idea where to look at. I'm quite a newbie using sendmail!

Thanks a lot in advance!
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Too many emails in one go perhaps? - how to fix sendmail?

Post by Chris Corbyn »

Changing the sendmail configuration may not even fix this problem. It occurs when the stress imposed on the server is so high that it fails to respond back to Swift Mailer.

There are a few things you can do:

a) Use batchSend() instead of send() if possible
b) Make use of try/catch to handle the Exception
c) Use the AntiFlood plugin to allow the server to rest.
tata668
Forum Newbie
Posts: 3
Joined: Mon Feb 16, 2009 11:13 am

Re: Too many emails in one go perhaps? - how to fix sendmail?

Post by tata668 »

Thanks a lot, I'll test that!
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Too many emails in one go perhaps? - how to fix sendmail?

Post by Chris Corbyn »

Could you also try using version 4.0.0-b5 that is linked to at the top of this forum? :) It may be more error-tolerant.

You will need to rewrite the code for this though.
tata668
Forum Newbie
Posts: 3
Joined: Mon Feb 16, 2009 11:13 am

Re: Too many emails in one go perhaps? - how to fix sendmail?

Post by tata668 »

I'll do it, thanks for the suggestion.
Post Reply