I developed a web application and one of the function is to send emails.
I like to have the behaviour whereby the actual sending of emails is done in a batch job. Meaning when user click on the trigger button in online screen. The job for sending emails will be scheduled to run instead of immediately run.
How to do that exaclty? Any sample code references etc?