Hey I'm working on an Email Bot using the SMTP
python library. Can someone explain the error I'm getting and also mention the solution to this problem.
I'm using the Pycharm
code editor and
this is my code:
# importing mail protocol package
import smtplib
server = smtplib.SMTP('[email protected]', '******')
server.starttls()
server.login('[email protected]'
'!#$$%^[email protected]',
'This is just a test to see if Rocland email bot works or not.')
This is the error I'm getting...
/home/rohan/Rocland_Python/Rocland/venv/bin/python
"/home/rohan/Rocland_Python/Rocland/Rocland Email Bot.py"
Traceback (most recent call last):
File "/home/rohan/Rocland_Python/Rocland/Rocland Email Bot.py", line 3, in <module>
server = smtplib.SMTP('[email protected]', 'rocland!2007')
File "/usr/lib/python3.9/smtplib.py", line 253, in __init__
(code, msg) = self.connect(host, port)
File "/usr/lib/python3.9/smtplib.py", line 339, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "/usr/lib/python3.9/smtplib.py", line 310, in _get_socket
return socket.create_connection((host, port), timeout,
File "/usr/lib/python3.9/socket.py", line 822, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/usr/lib/python3.9/socket.py", line 953, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -8] Servname not supported for ai_socktype
Process finished with exit code 1
I would really appreciate it if you explained this error and give me the solution to the problem. Thanks in advance!
question from:https://stackoverflow.com/questions/65839529/getting-errors-while-running-smtp-python-library