Creating an email queue in PHP?

Yep, this is pretty straightforwards to implement. Rather than immediately sending, save the e-mail data to a database. Have a script (running every minute via cron, or better yet a daemonized PHP script) that takes the queued e-mails and sends them out.

Be sure to have flags in your database to indicate progress, i.e. a column for "sending" and one for "sent", so your script knows not to try to repeatedly send one that's already in the process of being sent.


Run a local MX that will only pick up from localhost, and will relay to the "real" MX.

Tags:

Php

Email

Mime