I'm currently using SMTP (connecting to Office365) to launch an email (using PEAR in PHP) whenever someone visits a page for an email notification on my Linode server (Ubuntu 15.04). My problem is that connecting to the Office365 server takes quite some time (~10 seconds), and because of this it takes a long time for the page to load until the email is sent. Is there any way for me to somehow use PEAR to send mail in the background without altering the user's page load time?
I've looked at PEAR Mail Queue and that seems like an option, however I'm wondering if there's a workaround rather than having a cron job running every x minutes