I understand that speeding up the PHP side of things is not really possible. I am running Parallels Plesk on Linux with APACHE. At the moment the wait time can be up to 40 minutes. I am using
mail($to, $subject, $body, $headers, -odb)
I mean the time it take for the email to appear in the users inbox after the script sending the email.
Any help or suggestions would be much appreciated.
2
Answers
The
mail()
function actually has absolutely NOTHING to do with delivery of email. All it does is hand your email over to the server’s own SMTP server. Basically it’s the equivalent of dropping your letter in the mail box.After that, it’s up to the postal service (the various SMTP servers, spam filters, antivirus scanners, the ‘Net in general, etc..) to do the actual delivery, and you have basically no control whatsoever over that. All you can choose is which mailbox to drop the letter into.
As Marc B stated, the
mail()
function has nothing to do with the delivery of email.Although it may not help with delivery time, something to help your deliver-ability would be to make sure you have an SPF record on your DNS.
You might also want to check your server security logs to make sure random people aren’t bogging down your server with lots of SMTP traffic. If your server is improperly configured, you may be allowing outsiders to send mail via your server. Look into sshguard
Additionally, if your mail queue is large (lots of calls to
mail()
), it will take longer to send the mail created bymail()
. ~40 minutes would be an extraordinarily large queue, though.