我想用smtplib在python 2.7中發送郵件。下面的代碼很簡單:smtplib.SMTPAuthenticationError:(535,'5.7.3身份驗證不成功')
import smtplib
def main(argv=None):
sender = '[email protected]'
receivers = ['[email protected]']
message = """
This is a test e-mail message.
"""
smtpObj = smtplib.SMTP('[email protected]',25)
smtpObj.login('abc', 'pwd')
smtpObj.sendmail(sender, receivers, message)
print "Successfully sent email"
if __name__ == '__main__':
main()
現在,當我執行下面的代碼,我不斷收到此異常:
smtplib.SMTPAuthenticationError:(535, '5.7.3身份驗證不成功')。
請注意。
謝謝,
同樣的事情,我也忘了 –