Scheduled email sending with PHP

2

Save personal, I'm new here and I have a very peculiar question. I'm developing a system (CodeIgniter + MySQL) that records some events and should send an email on a predefined date, something around eight or nine months ahead. How can I schedule the sending of this email so that when that date arrives the email will be sent without user intervention?

    
asked by anonymous 26.05.2015 / 13:09

2 answers

1
Many systems happen this, have an event that will be on a specific date and have to trigger an email in a certain period before to notify.

What I did was to create a cronjob and this routine calls a controller/metodo that does a reading in the table that has the events and with that to trigger the emails.

I advise you to take a look at the documentation itself link

    
26.05.2015 / 13:51
0

What I would do is the following, create a date field in this table and this field will receive that date that will be to set the day of submission, create a basic file in PHP and using only PHP without any HTML and in this file you create a function that searches this date field and make sure it is the same as the current date and if it is you fire the email to the person.

This file that takes care of the sending you create a task in your hosting to run it from time to time, there is automatic sending without human intervention.

If you have any questions about how to do all this, just give it a try.

    
26.05.2015 / 13:17