I'm building a web application. One of the major feature of this application is, it sends email to all the users based on their preferences which can be set weekly or monthly. The email sending has to be executed using cron. The email will contain a csv or xml file which is actually a report for the user generated by the system. That means, each user will get different file. And there can be thousands of users. I'm using codeigniter framework for the app.
My question is, what will be the efficient way for this kind situation? I didn't use cronjob previously. So, I'm afraid about the server resources it will take for this kind of execution. I also want to know how much time it will take for sending 1000 such email and is their any chances of execution time out or server crash? And should I use codeigniter's built in email class?