我正在使用smtplib
通过 AOL 帐户发送电子邮件,但在成功验证后它被拒绝并出现以下错误。
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 帐户成功发送了相同的电子邮件,没有任何问题吗?