Answer the question
In order to leave comments, you need to log in
How to send an email to Gmail?
I'm trying to send an email to my own gmail account, it gives me this error.
Traceback (most recent call last):
File "D:\Code\Python\Basic\SendTheEmail.py", line 18, in
mail.login('login', 'password')
File "C:\Python33\lib\smtplib .py", line 638, in login
raise SMTPAuthenticationError(code, resp)
smtplib.SMTPAuthenticationError: (534, b'5.7.9 Application-specific password required. Learn more at\n5.7.9 https://support.google.com /accounts/answer/185833 wl7sm841456lbb.45 - gsmtp')
import smtplib
content = "Hello from Python"
mail = smtplib.SMTP('smtp.gmail.com', 587)
mail.ehlo()
mail.starttls()
mail.login('[email protected]', 'password')
mail.sendmail('[email protected]', '[email protected]' , 'Hello there')
mail.close()
Answer the question
In order to leave comments, you need to log in
Have you tried reading https://support.google.com/accounts/answer/185833 ?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question