Creating an email queue in PHP?

情到浓时终转凉″ 提交于 2019-12-01 05:11:42

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.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!