Our web site (Apache/Unix) generates orders (200-400 a day) which are sent both to customers an processing center. To do this, I use PhpMailer (Mail).
Usually, Send() returns true, but ~1-2% of mails don't reach their destinations (either customer or processing center or both).
It also could happen a period (usually on a weekend, for example - this Sunday between 5pm-7pm ) when Send() returns false in 30-50% of mailes, even if I retry it few times.
In order to decrease the number of filed emails, I send the order to 2 independent destinations, but it did not help much - during this strange period where ~30% of emails failed, only 5% of them were delivered to an alternative address.
My general question is too general - how can I improve the situation with emails?
- are there more reliable, supported classes for php mail?
- is there a way to check PhpMailer and system logs to find out what was sent, what was not and why?
I've never worked in such high volumes, but we do have a script we use once in a while to send out 200+ mails. I rarely get failures, and those are only from bad addresses as far as I can remember, never had a timeout.
As far as I know PHPMailer is the king of php mail classes. Maybe you have network glitches from time to time, or something with your sendmail program.
Sorry, this probably doesn't help much
My Site
Web Design On Linux: Sure It Takes Longer To Get It Right In IE, But Who Really Cares?
I'm expecting that the problem isn't with the mail functions, but with the servers internet connection. Because the time during which the problems occur, I'm guessing that there is a lot of traffic on the network. If the server gets temporarily disconnected because there isn't enough bandwidth, that might cause the current email to fail. If you're sending 400+ emails at a time, that costs a LOT of bandwidth which could mean that your internet connection can't handle the strain and thus it's dropping a lot of 'important' packets.
I'm no networking specialist, but I expect that if you put a temporary pause in the send mail scripts, so it only sends X mails a minute It will probably help the problem.
Another option is to try to send the emails at night (04:00 AM for example) At that time, most people are asleep in your area, thus the server and network load should be a lot lower.
If that helps you'll know what the problem is.
It's 200-400 emails per day (24 hours - which means 1 in every few minutes) - which should not be considered as a substantial.
On other hands, it looks a bit strange that all it happens in compact periods of time. For example, here is a list of failed emails for the whole last week (Sep. 3-10) (last column is an order number)
There are a number of other problems that might be causing problems.
If it's a shared server, another user might be overloading the system.
There might be a processor intensive cronjob planned at certain times.
The system memory might be full/corrupt and thus it's leaking data it's supposed to send.
One of the networks routers might be malfunctioning.
I don't know whether this is a personal server, or colocated, or shared, but you might want to check with the hosting and see if they've been having problems with any of the hardware. Explain the problem to them and they might be able to help you eliminate any hardwarebased problems.
Yes, it's a shared server. The problem is it'd be difficult to convince host support that it's something on their side, unless I have a proof (log files).
Originally Posted by DJsAC
There are a number of other problems that might be causing problems.
If it's a shared server, another user might be overloading the system.
There might be a processor intensive cronjob planned at certain times.
The system memory might be full/corrupt and thus it's leaking data it's supposed to send.
One of the networks routers might be malfunctioning.
I don't know whether this is a personal server, or colocated, or shared, but you might want to check with the hosting and see if they've been having problems with any of the hardware. Explain the problem to them and they might be able to help you eliminate any hardwarebased problems.
Bookmarks