I am trying to send email (Gmail) using python, but I am getting following error.
Traceback (most recent call last):
File \"emailSend.py\", line 14, in <
Not directly related but still worth pointing out is that my package tries to make sending gmail messages really quick and painless. It also tries to maintain a list of errors and tries to point to the solution immediately.
It would literally only need this code to do exactly what you wrote:
import yagmail
yag = yagmail.SMTP('user_me@gmail.com')
yag.send('user_you@gmail.com', 'Why,Oh why!')
Or a one liner:
yagmail.SMTP('user_me@gmail.com').send('user_you@gmail.com', 'Why,Oh why!')
For the package/installation please look at git or pip, available for both Python 2 and 3.