1

Code:

import smtplib
server = smtplib.SMTP('smtp.gmail.com:587')

It works with my local python setup but ide shows following error:

 File "/home/ubuntu/project/application.py", line 38, in contact
    server = smtplib.SMTP("smtp.gmail.com", 587)
  File "/usr/local/lib/python3.7/smtplib.py", line 251, in __init__
    (code, msg) = self.connect(host, port)
  File "/usr/local/lib/python3.7/smtplib.py", line 336, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "/usr/local/lib/python3.7/smtplib.py", line 307, in _get_socket
    self.source_address)
  File "/usr/local/lib/python3.7/socket.py", line 727, in create_connection
    raise err
  File "/usr/local/lib/python3.7/socket.py", line 716, in create_connection
    sock.connect(sa)
OSError: [Errno 99] Cannot assign requested address

You must log in to answer this question.

Browse other questions tagged .