전자 메일을 보내기 위해 Python의 smtplib 모듈을 사용하려고하지만 계속 TimeoutError
을받습니다.smtplib을 사용하여 전자 메일을 보내려는 TimeoutError
import smtplib
def send():
try:
server = smtplib.SMTP('smtp.gmail.com', 587)
server.ehlo()
server.starttls()
server.login(email, password) # Email and password are already defined
print('Enter recipient: ')
recipient = input()
print('Enter subject:')
subject = input() + '\n'
print('Enter body:')
body = input()
server.sendmail(email, recipient, body)
server.quit()
except TimeoutError as e:
print (str(e))
이 코드는 접수에 : 당신이 사용할 수 Gmail 계정에서 옵션 '보안 수준이 낮은 앱 허용'하지 않은 것처럼
[WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
아마 연결 문제 또는 방화벽? – jpnkls