smtplib sendmail in python fails SMTPHeloError: (501, b'5.5.4 Invalid Address') -
i wrote following code:
import smtplib my_address = 'myaddress@msn.com' hears = [ 'subject: test', 'from: ' + my_address, 'to: ' + my_address, ] entries = "hello" msg ='r\n'.join(hears) + 'r\n' + ' '.join(entries) smtp = smtplib.smtp('smtp.live.com',587) smtp.starttls('smtp.live.com') smtp.sendmail(my_address, [my_address] , msg) smtp.close()
i got error message:
traceback (most recent call last): file "c:\python33\sssemail.py", line 11, in <module> smtp.starttls('smtp.live.com') file "c:\python33\lib\smtplib.py", line 652, in starttls self.ehlo_or_helo_if_needed() file "c:\python33\lib\smtplib.py", line 553, in ehlo_or_helo_if_needed raise smtpheloerror(code, resp) smtplib.smtpheloerror: (501, b'5.5.4 invalid address')
can 1 give me insight on happening?
Comments
Post a Comment