When a user views a certain profile page I need to send the end user an email but would like to do this asynchronously if at all possible. Can this be done with PHP? I really don't want to wait for the PHP function to complete before rendering the rest of the page. It should be seamless to the user.
Or is this a better solution from the client side:
$.post("msg.php?user=xxx", function(data) {
....
}, "json");
Is there a preferred method?