I am trying to use smtplib for sending mails in python 2.7. The below code is pretty simple:
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()
Now when I execute the below code, I keep getting this exception:
smtplib.SMTPAuthenticationError: (535, '5.7.3 Authentication unsuccessful').
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…