So you’ve got an HP multifunction printer with scan-to-email functionality, and you’ve followed all of HP’s instructions for configuring Gmail SMTP in your printer, but every time you go to scan-to-email, it gets stuck for minutes at a time on the “connecting to smtp.gmail.com” message?
There seems to be a problem with the IPV6 autoconfiguration on HP printers.
My suspicion is that the HP printer tries to negotiate via IPV6 first if it sees that your router has assigned an IPV6 IP to the printer. However, since many residential grade ISPs have only partially implemented IPV6 (e.g. Telstra has some IPV6 services visible to residential customers but does not actually have globally routable IPV6 traffic except for business customers…) I think the printer is tripping up on this, and then trying for a few minutes before giving up and falling back to IPV4.
If all of this sounds like gobbledigook to you, don’t worry. All you have to do is go to the printer’s admin web page and disable the IPv6 functionality. Networking Tab, then the Advanced submenu on the left side. Untick the IPv6 option and click apply.
Your scan-to-email connection to gmail should now just take a few seconds, not the extended period it took before while the printer presumably tried in vain to establish an IPv6 connection.