5

So I just moved to a new VPS host and the PHP Mail function basically never ends (although oddly enough it usually sends the email).

I set this in my php.ini: sendmail_path = /usr/sbin/sendmail -i -t

Anyone have any ideas why this would be taking so long? I even set a start/end variable and printed the time in between and it's literally 60 seconds.

Anyone have any ideas?

5
  • Perhaps it is your hosts anti-spam measure. You should contact your host. Commented Mar 1, 2012 at 1:29
  • 2
    My best guess would be a misconfiguration in DNS lookups, most likely how sendmail tries to look up its own hostname. This question is much more appropriate for Serverfault though. Commented Mar 1, 2012 at 1:38
  • 1
    That might make sense, I haven't set up the hostname properly.. I checked w/the host I know it's not that Commented Mar 1, 2012 at 1:41
  • 1
    If you have shell access to the VPS, you could try running sendmail from the command line to send an email. That would narrow down the source of the delay to sendmail itself or PHP. Commented Mar 1, 2012 at 1:51
  • Which version of PHP/sendmail are you using? Do you have an example message that you're sending? Commented Mar 6, 2012 at 19:43

1 Answer 1

2

Mail functions in php is script are slow but 60 sec is too much. Best way is to insert the mail to be sent in Database and send them via cron later (every 2 min). Using Mail queue technique.

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

Comments

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.