Skip to:
Content
Pages
Categories
Search
Top
Bottom

How can I remove the php delay when users are emailed

  • @_ck_

    Participant

    I’ve noticed with certain plugins that email users, like favorites notification and others, that PHP will sit and wait until it gets a response back from the mail function.

    Is there any kind of drop in replacement for mail() that will just queue the email and come back to php and load the rest of the page asap?

Viewing 1 replies (of 1 total)
  • @_ck_

    Participant

    I think I found the answer to my question with a bit of sendmail/exim research.

    Apparently adding “-odq” to the end of the mail() options will force it to queue only, which means instant response back to the user. However that delays mail of course until the next exim run. “-odb” is supposed to be the default, running the delivery in the background and not while mail() waits, but I seem to get the best of both worlds, instant delivery and no wait on mail() when I force it, so forced it is.

    Recommended for other plugins that use mail:

    mail($to,$subject,$message,$headers,”-odb”);

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar