0
Currently, as the sending of the email was giving a lag in the application, because it has to connect with Gmail etc, I transferred to the server the mission to send these messages, as follows::
- User writes to
tbl_msg
the message and the addressee. - On the server I have an open page that is giving Reload every 10 seconds.
- This page searches the database for the
tbl_msg
, when it finds it, it executes a PHP code that sends the email.
This way the application for the user does not suffer any lag.
What I want
It is possible for the bank itself to do something that if any data is recorded in the tbl_msg
Mysql automatically runs the PHP statement, without having to have an open page?
I would like to confirm this in a reply, but I’m not sure. But you can create a task in some kind of crontab running a PHP script each
n
seconds. This script would check if there are any emails to be sent and, if there are any, send this email.– gabrielhof
In fact what you want is to run this process in the background, known as Workers. Here you can check out some tips on getting started.
– gmsantos
My server is windows, and I don’t think it’s right to leave a page open on the server giving Reload. A little problem in Bronwse and msgs are not sent.
– theteo