0

I am using php sendmail() function in my projects. When I sent above 3 or more mails processing gets too slow. What is the problem? If I use PHPMailer, will this problem solve?

2 Answers 2

1

There are a few things that can be causing this to be slow.

You may be waiting for each email to be fully sent before sendmail() returns. This will mean opening a SMTP socket, talking to another mail server, sending the email and closing up the socket again.

We have a system that sends quite a few emails out in batches and we use PHPMailer for that. We open the socket once, send lots of messages then close it up again, and we get good performance on this (it can send several hundred emails in a single run).

If your message is identical to all recpients, I would recommend sending them all in a single email and BCC'ing everyone, as this takes a lot of pressure away from your script.

Another thing to check is local virus scanners. We used to have problems with the outgoing email scanner grinding the whole thing to a halt. Worth looking into.

Sign up to request clarification or add additional context in comments.

3 Comments

Thank you rikh. I tried to sent mail through BCC, but same result.
BCCing is not always desired as ALL email addresses will still present in EVERY message. So, if someone will like to spam ALL your customers, he will easily do that.
Hmm, I don't think so. If you CC everyone, then sure, they will all be able to see the list, but BCC (Blind Carbon Copy) should not include information on anyone else in the BCC list.
1

Seems, your mail() functions has some restrictions applied to sendmail or some problems. Try sending mail via SMTP for example using this :http://swiftmailer.org/ and see if it will solve your problem.

4 Comments

Thank you. I need to build a newsletter management so I need script which is more faster i will try swiftmailer.
Ok ;) Don't forget one of the replies after you will solve your case.
I used swiftmailer in my website, i able to sent more than 500 quickly. It solved my problem and also it has many option. Thank you for all.
Welcome. Please don't forget to mark one of the answers as the one, which solved your problem to accept answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.