I am very new to python. I was trying to send a mail using a python script. But getting the below mentioned error:
$ python main.py
Traceback (most recent call last):
File "main.py", line 8, in <module>
server.login("rake.son25@gmail.com", "*********")
File "C:\Python27\lib\smtplib.py", line 622, in login
raise SMTPAuthenticationError(code, resp)
smtplib.SMTPAuthenticationError: (534, '5.7.14 <https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbvm\n5.7.14 7HCHLzWCRCqEWA7MrN_ugeXO84BVMOFJ0g1E6_G7PGiHJmzxMOLKwsWe8s1STDSdnu62FE\n5.7.14 kiIxlsG8SNxbLi6J9ldrBZZlGEq7iQwdu_jyiZqCBnbaMilPIb8h0n8qbQ-qIlgqkBwb8n\n5.7.14 Fu3wlNDH2Eb8nSYcTEZgZT7o-LS_tdj393kLlex2GILGCcy7McM6r72Ml1u7Dl-fc7hWjM\n5.7.14 int0yILB5Ab1MYcNt8uigK2ZyemJU> Please log in via your web browser and\n5.7.14 then try again.\n5.7.14 Learn more at\n5.7.14 https://support.google.com/mail/answer/78754 fj19sm61312778pab.37 - gsmtp')
But I mentioned the correct pw and email in the script. main.py:
import smtplib
msg = "YOUR MESSAGE!"
server = smtplib.SMTP('smtp.googlemail.com')
server.ehlo()
server.starttls()
server.login("rake.son25@gmail.com", "mypassword")
server.sendmail("rake.son25@gmail.com", "rakeshlochansarma25@gmail.com",msg)
server.quit()