내 작업은 imap 또는 pop3 서버 주소를 사용하여 이메일을 읽는 것입니다. 파이썬을 사용하여이 작업을 수행하려고합니다. 이 작업을 수행 할 수있는 모든 샘플 코드는 아래에 언급 된 오류를 던졌습니다.imap 또는 pop3 서버에서 이메일 읽기
"오류 : [Errno 10060] 일정 기간이 지난 후에 연결된 당사자가 올바르게 응답하지 않았거나 연결로 인해 연결이 실패하여 연결하지 못했습니다. 호스트가 응답하지 못했습니다. "
문제점은 무엇일 수 있습니까? 내 로컬 방화벽 설정입니까? 아니면 다른 이유로 ... ... ????
import imaplib
imap_host = 'imap.gmail.com'
imap_user = '****@gmail.com'
imap_pass = '****'
## open a connection
imap = imaplib.IMAP4_SSL(imap_host)
## login
imap.login(imap_user, imap_pass)
및
import sys
import chilkat
imap = chilkat.CkImap()
# Anything unlocks the component and begins a fully-functional 30-day trial.
success = imap.UnlockComponent("Anything for 30-day trial")
if (success != True):
print(imap.lastErrorText())
sys.exit()
# Turn on session logging:
imap.put_KeepSessionLog(True)
# Connect to GMail
# Use TLS
imap.put_Ssl(True)
imap.put_Port(993)
success = imap.Connect("imap.gmail.com")
if (success != True):
print(imap.lastErrorText())
sys.exit()
# Login
# Your login is typically your GMail email address.
success = imap.Login("***@gmail.com","*****")
if (success != True):
print(imap.lastErrorText())
sys.exit()
# Select an IMAP mailbox
success = imap.SelectMailbox("Inbox")
if (success != True):
print(imap.lastErrorText())
sys.exit()
# Show the session log.
print(imap.sessionLog())
# Disconnect from the IMAP server.
success = imap.Disconnect()
용 Gmail 도움말 페이지를 체크 아웃 가치가있을 수도? 우리는 당신이하려는 일을 모른 채 시간 초과 원인을 알 수 없습니다. – Quitty
포트 143에 연결하려고합니다. Gmail은 SSL 래핑을 사용하여 포트 993에서만 응답합니다. – arnt