I've written a small function that essentially collects a load of emails from the (mySQL) database and creates an email to send out.
The email is created in a RTE (TinyMCE) and the Admin user then clicks on a button to send the email to his selected mailing list.
What I want to do is have that mailout function work in the background whilst a page is returned to the Admin user stating the email has been queued, or something similar.
At the moment, because of restrictions on the mail server, I need to 'sleep' my mailout loop but I don't want the Admin user to be waiting for the function to finish before they get a server response.
So how would I kick into action the function in the background whilst I return a 'finished' page to the user?
The email is created in a RTE (TinyMCE) and the Admin user then clicks on a button to send the email to his selected mailing list.
What I want to do is have that mailout function work in the background whilst a page is returned to the Admin user stating the email has been queued, or something similar.
At the moment, because of restrictions on the mail server, I need to 'sleep' my mailout loop but I don't want the Admin user to be waiting for the function to finish before they get a server response.
So how would I kick into action the function in the background whilst I return a 'finished' page to the user?