I am trying to figure out why my Gmail PHPMailer sends are soooo slow (more than a minute for a tiny email). I tried the following:
telnet smtp.gmail.com 587
…I get a message saying that the server is (I added the etc’s)
Trying 2607:f8b0:etc:etc::6c…"
Then, 4 minutes later, this output appeared:
Trying 64.233.etc.etc Connected to smtp.gmail.com Escape character is ‘^]’. 220 mx.google.com etc…
I believe that I have everything configured to send mail. I do receive the emails, but not for several minutes.
Can anyone shed some light on this situation? Could this be why PHPMailer is so slow? Thanks!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
It appears to be because of IPV6
ben@rweb1:~/smtptest$ time telnet smtp.gmail.com 587 Trying 2a00:1450:400c:c06::6d…
fails
ben@rweb1:~/smtptest$ telnet 64.233.184.108 587 Trying 64.233.184.108… Connected to 64.233.184.108. Escape character is ‘^]’. 220 smtp.gmail.com ESMTP y145sm13837556wmc.17 - gsmtp
does not
i am trying to connect to the port 465 through smtplib in python but I m unable to do so and it remains in hung state : import smtplib settings = {‘username’: u’STCSMTP\n’, ‘use_tls’: False, ‘host’: u’smtp.gmail.com’, ‘sender’: u’STCSMTP@gmail.com\n’, ‘use_ssl’: True, ‘password’: u’STCSupport123’, ‘port’: 465} host = settings[‘host’].strip() s = smtplib.SMTP_SSL(host, settings.get(‘port’, 465))
It looks like you’re timing out on IPv6 connections which is why it’s taking so long.
If you have netfilter rules for IPv6 you may want to consider revising them, or if it’s DO blocking you you will want to contact support.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.