It's possible, but a lot of changes.
You'd have to use AJAX to request that the PHP code send the email and then get a response back from the PHP code that tells the main page what to do. Your existing PHP mailer page would need several changes, of course.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.