1

AOL アカウント経由でメールを送信するために使用smtplibしていますが、認証が成功すると、次のエラーで拒否されます。

reply: '521 5.2.1 :  AOL will not accept delivery of this message.\r\n'
reply: retcode (521); Msg: 5.2.1 :  AOL will not accept delivery of this message.
data: (521, '5.2.1 :  AOL will not accept delivery of this message.')

このエラーの説明は次のとおりです。

The SMTP reply code 521 indicates an Internet mail host DOES NOT ACCEPT
incoming mail. If you are receiving this error it indicates a configuration
error on the part of the recipient organisation, i.e. inbound e-mail traffic
is being routed through a mail server which has been explicitly configured
(intentionally or not) to NOT ACCEPT incoming e-mail.

受信者メール (私のスクリプト内) は有効な (gmail) アドレスであり、このデバッグ メッセージの後、メールは拒否されます。

send: 'Content-Type: text/plain; charset="us-ascii"\r\nMIME-Version:    1.0\r\nContent-Transfer-Encoding: 7bit\r\nSubject: My reports\r\nFrom: myAOLmail@aol.com\r\nTo: reportmail@gmail.com\r\n\r\nDo you have my reports?\r\n.\r\n'

コードの短いバージョンは次のとおりです。

r_mail = MIMEText('Do you have my reports?')
r_mail['Subject'] = 'My reports'
r_mail['From'] = e_mail
r_mail['To'] = 'reportmail@gmail.com'

mail = smtplib.SMTP("smtp.aol.com", 587)
mail.set_debuglevel(True)
mail.ehlo()
mail.starttls()
mail.login(e_mail, password)
mail.sendmail(e_mail, ['reportmail@gmail.com'] , r_mail.as_string())

Yahoo アカウントで同じメールを問題なく送信できているため、これは何らかの権限の問題ですか?

4

2 に答える 2

0

AOL がデフォルトでリレー アクセスを許可していないか、手動で設定していないと思います。表示されるエラーは、メッセージを送信する受信者が aol にないことを示しています。この場合、メールを gmail アカウントに送信する場合は、AOL ではなく gmail SMPT サーバーに接続してみてください。

たとえば、 smpt サーバーを変更gmail-smtp-in.l.google.comし、認証をオフにします。

于 2015-09-30T13:45:39.363 に答える