On my local machine using XAMPP, I'm opening an office365 account via imap_open
, displaying the number of messages in the inbox and then closing IMAP.
$hostname = "{outlook.office365.com:993/imap/ssl/novalidate-cert}INBOX";
$imap = imap_open($hostname, 'email', 'password');
$message_count = imap_num_msg($imap);
echo $message_count;
imap_close($imap);
Every time I run this script it takes a whopping 15 seconds to complete. When I upload it to my hosting at GoDaddy, it takes about 12 seconds which is still an insanely huge amount of time.
I've tried substituting the "outlook.office365" domain with their IP address but somehow that just makes things even slower.
Is there any way I can speed this up?