Python: Connecting to gmail server using poplib giving error

697 Views Asked by At

I am trying to connect to gmail server using POP protocol using poplib library. it fails to connect with error:socket.gaierror: [Errno -2] Name or service not known

I have network access from the machine i am running my script.

import poplib
pop_conn = poplib.POP3_SSL('pop.gmail.com',995, timeout=30)

Traceback (most recent call last):
  File "python", line 2, in <module>
socket.gaierror: [Errno -2] Name or service not known

Please help in rectifying this?

I got the gmail server name from the below link: https://support.google.com/mail/answer/7104828?hl=en&visit_id=1-636148818957220191-1947633130&rd=3

0

There are 0 best solutions below