Skip to content
Advertisement

Cron + PHPMailer Email Queue

I have a doubt, I am thinking of making an email queue and using cron job for this task, but on my website there is an email verification system, I wanted these verification emails to be delivered as quickly as possible, as I could make work? I don’t need a code, just an opinion

Advertisement

Answer

Don’t do it. There are these really clever things that do an excellent job of queueing and delivering email messages, handling rejections, throttling, temporary outages, and lots more, and they are way, way faster than anything you’ll write in PHP. They are called “mail servers”.

Install a local mail server (e.g. postfix), then send into that directly from your PHP scripts (using SMTP to localhost, as it’s faster and safer than using mail()). Your scripts will run very fast, and the mail server will deal with onward delivery. Beyond that, read the PHPMailer docs on improving delivery.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement