Cannot connect to Gmail from behind VPN

When behind some VPNs, attempting to connect to a Google account via Mailspring fails:

Connection Error - Unable to connect to the server / port you provided. (SMTP)

This appears to occur when Mailspring is behind a VPN.