Flask-Mail failing Flask-Mail failing flask flask

Flask-Mail failing


The stack trace indicates that the timeout occurs in the socket.gethostbyname call. This function takes a hostname (presumably the "smtp.gmail.com" from your settings) and converts it to an IP address, after doing a DNS lookup.

The fact that the function times out suggests the system on which you are running this is unable to resolve the name smtp.gmail.com.

The most obvious reason for this failure is that the system is not connected to the net, or that the network settings prevent it from connecting.

You can try pinging the hostname from the command line to see what happens:

$ ping smtp.gmail.comPinging gmail-smtp-msa.l.google.com [74.125.25.108] with 32 bytes of data:Reply from 74.125.25.108: bytes=32 time=17ms TTL=47Reply from 74.125.25.108: bytes=32 time=16ms TTL=47Reply from 74.125.25.108: bytes=32 time=18ms TTL=47Reply from 74.125.25.108: bytes=32 time=17ms TTL=47Ping statistics for 74.125.25.108:    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:    Minimum = 16ms, Maximum = 18ms, Average = 17ms