3
I have to create a function (task) on the server of my site that sends a birthday email, containing an HTML code, to birthday emails.
Detail: these birthdays are registered in a Mysql table that contains name, e-mail and date of birth. Therefore, if there are names in this table whose day and month are equal to today’s date, send the birthday e-mail to these names.
Therefore, the task would be to integrate with Mysql and send these emails depending on the result of the query (day and month equal to the current date, send e-mail. Otherwise, you’re not in charge).
How can I do that?
What have you tried?
– Sr. André Baill
So far, nothing. I know there are companies that offer more software dedicated to this type of thing. But if by task Checker could do this... if you have to create some code in PHP and Javascript, is not the problem. The problem would be how to activate this automatic email sending, always considering it has to be when the email owner’s birthday is today.
– Gustavo Hoppe Levin
Will you incorporate this into your website? How do you think to do?
– Sr. André Baill
I thought of incorporating on the site. But I also thought if the most appropriate solution is not to make a BAT file that is saved on the server and that makes this SQL query to send the emails later.
– Gustavo Hoppe Levin
I think you can process on the index... that’s a lot of records?
– Sr. André Baill
Made the script processing by include no index, we send according to select, and believe to optimize well, you can even send in smtp, which is more difficult to be considered as spam, of course there are other auxiliary rules...
– Sr. André Baill
The number of records depends a lot on how many birthdays you have on a given day. Sometimes you can have several, sometimes few, sometimes one, sometimes none. Do you have any idea of code? @Andrébaill
– Gustavo Hoppe Levin
No, then we would have to elaborate... if you start the code and the tests, I can help you until we come up with a solution.
– Sr. André Baill
The best option is to use Cronjob, you create one on your server to always run a url to the php file responsible for firing. Do it once a day, and it’s over! It’s automatic and you’ll only need PHP. The CRONJOB to be done by CPANEL is very simple!
– caiocafardo