여기 내 스크립트입니다. Gmail의 요구 사항 때문에 스크립트에서 시작 문자를 사용합니다. 나는 2 개의 웹 주인, 1and1 및 webfaction에 이것을 시도했다. 1and1은 나에게 'connection refused'오류를 표시하고 webfaction은 오류를보고하지 않지만 전자 메일을 보내지 않습니다. 스크립트에 문제가있는 것을 볼 수 없으므로 웹 호스트와 관련이 있다고 생각합니다. 어떤 생각이나 의견이라도 감사하게 생각합니다.smtplib과의 Gmail 파이썬 스크립트 문제
편집 : 디버그 모드가 켜져 있습니다. 출력에서 메시지를 성공적으로 보낸 것처럼 보입니다 ... 나는 메시지를받지 못했습니다.
send: 'ehlo web65.webfaction.com\r\n'
reply: '250-mx.google.com at your service, [174.133.21.84]\r\n'
reply: '250-SIZE 35651584\r\n'
reply: '250-8BITMIME\r\n'
reply: '250-STARTTLS\r\n'
reply: '250-ENHANCEDSTATUSCODES\r\n'
reply: '250 PIPELINING\r\n'
reply: retcode (250); Msg: mx.google.com at your service, [174.133.21.84]
SIZE 35651584
8BITMIME
STARTTLS
ENHANCEDSTATUSCODES
PIPELINING
send: 'STARTTLS\r\n'
reply: '220 2.0.0 Ready to start TLS\r\n'
reply: retcode (220); Msg: 2.0.0 Ready to start TLS
send: 'ehlo web65.webfaction.com\r\n'
reply: '250-mx.google.com at your service, [174.133.21.84]\r\n'
reply: '250-SIZE 35651584\r\n'
reply: '250-8BITMIME\r\n'
reply: '250-AUTH LOGIN PLAIN\r\n'
reply: '250-ENHANCEDSTATUSCODES\r\n'
reply: '250 PIPELINING\r\n'
reply: retcode (250); Msg: mx.google.com at your service, [174.133.21.84]
SIZE 35651584
8BITMIME
AUTH LOGIN PLAIN
ENHANCEDSTATUSCODES
PIPELINING
send: 'AUTH PLAIN *****\r\n'
reply: '235 2.7.0 Accepted\r\n'
reply: retcode (235); Msg: 2.7.0 Accepted
send: 'mail FROM:<[email protected]> size=12\r\n'
reply: '250 2.1.0 OK 4sm652580yxq.48\r\n'
reply: retcode (250); Msg: 2.1.0 OK 4sm652580yxq.48
send: 'rcpt TO:<[email protected]>\r\n'
reply: '250 2.1.5 OK 4sm652580yxq.48\r\n'
reply: retcode (250); Msg: 2.1.5 OK 4sm652580yxq.48
send: 'data\r\n'
reply: '354 Go ahead 4sm652580yxq.48\r\n'
reply: retcode (354); Msg: Go ahead 4sm652580yxq.48
data: (354, 'Go ahead 4sm652580yxq.48')
send: 'Hello world.\r\n.\r\n'
reply: '250 2.0.0 OK 1240421143 4sm652580yxq.48\r\n'
reply: retcode (250); Msg: 2.0.0 OK 1240421143 4sm652580yxq.48
data: (250, '2.0.0 OK 1240421143 4sm652580yxq.48')
대신 직접 Gmail을 호출하는 일반 SMTP 릴레이를 통해 메일을 보낼 수 있습니다. – gimel
디버깅 모드를 켜서 출력 메시지를 가져 오는 방법은 무엇입니까? – trusktr
smtplib.set_debuglevel (True)가 당신을 정렬합니다. @trusktr – hd1