Codeigniter mail vs swiftmailer for mass mail

I have an old system and a new one that I am developing:

on the old system, I used crontab and swiftmailer to send the newsletter. I wrote a PHP script that reads a mailing list from a database and sends emails to the whole list using swiftmailer + smtp with delays between each group of letters to make sure that I do not overload the server (swift mailer has this under Swift_Plugins_AntiFloodPlugin).

I also wrote another script that will scan the address that I send for incoming emails, detect error notifications, etc. and match the addresses for cleaning the database from inactive emails (i.e. if you send an email to an address that does not exist, you receive an error message, I selected the address from the content and deleted it from the database).

This method daily served more than 40 thousand emails. worked like a charm.

in the new system that I am writing, I use a code igniter. the built-in mail function for the code igniter seems to work fine, only 1 thing is missing: is it possible to add delays between submissions?

I know that just adding the swiftMailer library to my CI project, but before I do this, it can be done using the CI mail function. alone? are there any other advantages to adding a quick mailer in this case?

I know that many people will advise using something that was created for mass mailing by email, but the PHP CLI is like any other programming language in this case (I know about mailman, majordomo and services like mailchip. I can multithreaded in php with sysdaemons and mod_fork, etc., if necessary, but it does not matter for the question).

EDIT:

solvable

although I already added a quick email program (which took a few minutes), Sparks proposed by @JaredFarrish seems to be a solution as it is designed for CI.

+4
source share

Source: https://habr.com/ru/post/1386921/


All Articles