简体   繁体   English

如何解决:socket.gaierror: [Errno 11001] getaddrinfo failed

[英]How to solve: socket.gaierror: [Errno 11001] getaddrinfo failed

import smtplib

my_email = "NAME@gmail.com"
password = "PASSWORD"

receiver = "NAME@yahoo.com"

connection = smtplib.SMTP("smpt.gmail.com")
connection.starttls()
connection.login(user=my_email, password=password)
connection.sendmail(from_addr=my_email, to_addrs=receiver, msg="hello matafakha")
connection.close()

this is a code that i wanted to test, i am new to python and working with the smptlib, how do i solve this error?这是我想测试的代码,我是 python 的新手并使用 smptlib,我该如何解决这个错误?

connection = smtplib.SMTP("smpt.gmail.com")连接 = smtplib.SMTP("smpt.gmail.com")

You have a typo here.你这里有一个错字。 It should be:它应该是:

connection = smtplib.SMTP("smtp.gmail.com")

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 socket.gaierror:[Errno 11001] getaddrinfo 失败 - socket.gaierror: [Errno 11001] getaddrinfo failed (Python)socket.gaierror:[Errno 11001] getaddrinfo失败 - (Python) socket.gaierror: [Errno 11001] getaddrinfo failed Scapy导入错误'socket.gaierror:[Errno 11001] getaddrinfo失败' - Scapy import error 'socket.gaierror: [Errno 11001] getaddrinfo failed' 错误:- socket.gaierror:[Errno 11001] getaddrinfo 在获取请求中失败 - Error :- socket.gaierror: [Errno 11001] getaddrinfo failed in get request socket.gaierror: [Errno 11001] getaddrinfo 在 django 中失败 - socket.gaierror: [Errno 11001] getaddrinfo failed in django gaierror socket.gaierror: [Errno 11001] getaddrinfo 失败 mail.send(msg) - gaierror socket.gaierror: [Errno 11001] getaddrinfo failed mail.send(msg) 当我在 python 中使用套接字模块时,我收到此错误:'socket.gaierror: [Errno 11001] getaddrinfo failed' - I get this error:' socket.gaierror: [Errno 11001] getaddrinfo failed' when I use the socket module in python socket.gaierror:[Errno 11003] getaddrinfo失败 - socket.gaierror: [Errno 11003] getaddrinfo failed socket.gaierror: [Errno 11001] getaddrinfo failed" in python,同时使用简单的自定义 web 浏览器 - socket.gaierror: [Errno 11001] getaddrinfo failed" in python, while using a simple custom web browser Flask-Mail 显示 socket.gaierror: [Errno 11001] getaddrinfo failed - Flask-Mail showing socket.gaierror: [Errno 11001] getaddrinfo failed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM