I found few older threads that have a similar issue but most of them didn\'t have answers or if they had, the suggestions weren\'t relevant in my case.
I had a compl
The slowness (or failure due to timeouts) is because Google supports IPv6 addressing but your network does not. (e.g. Digital Ocean does not yet support IPv6 for SMTP traffic). So, use this:
$mail->Host = gethostbyname("smtp.gmail.com");
gethostbyname() will return the IPv4 address.
For me, my PHPMailer script went from ~2 minutes execution time to <4 seconds