tags:

views:

107

answers:

3

what is the main Logics between php mail(), sendmail(), using SMTP in php

why we are creating [email protected], [email protected],... and so on. Is there any problem in this?

WE are building Newsletter management which we try to sent minimum 6000 mails per day. Our domain is in dedicated sever.

WE are trying to sent 10,000 mails per day.

Which is the best solution.

I tried out swiftmailer it sent 4 mails and stoped with error message

"Unable to send message due to connection error"

some time it sent 100 and stopped.

What may be the problem is? Is it a coding problem or server problem

+1  A: 

mail() does not use SMTP; it delegates the actual sending of mail to the sendmail binary, so you have to configure the MTA on your system properly in order for it to work.

Ignacio Vazquez-Abrams
+2  A: 

I think your first action should be to check the SMTP server you're using (I assume you are using SMTP) whether it has any sending limits imposed. Then, speak to your ISP / provider whether they have any kind of spam detection in place that could prevent the sending of mass E-Mail.

If you are not using SMTP, but mail(), switch to SMTP. Mail() opens a new connection for every outgoing mail and is not recommended for sending larger quantities.

If nothing else helps, split the E-Mails into smaller jobs, making them easier for the server to digest, and/or add a few hundred milliseconds' pause in between sending of each mail.

Pekka
And have some error recovery strategy. Failure is always an option and your script has to deal with it.
VolkerK
If he has the mail server locally, one connection per mail is not a real problem (on the contrary, it can be an advantage as not everything will fail just because the connection went down once).
Emil Vikström
It may become a performance problem, though, when the whole system gets overloaded with sending requests.
Pekka
+1  A: 

There is no sendmail() function in PHP.

I tried out swiftmailer it sent 4 mails and stoped with error message "Unable to send message due to connection error"

Probably not a code error. Most likely candidate is that the SMTP server you are using is throttled to prevent use for bulk email sending. Have you asked your server provider / SMTP admin guy?

Solution is to run your SMTP server.

C.

symcbean