python send google email

Solutions on MaxInterview for python send google email by the best coders in the world

showing results for - "python send google email"
Kaidence
14 Jan 2017
1from smtplib import SMTP
2
3'''
4!!! Note !!!
5https://myaccount.google.com/u/1/lesssecureapps?gar=1&pli=1&rapt=AEjHL4MdKbqmGDVY3kiBYKtpeM_epFUujma99D11-QkUh52EZnY1B077b6t81iePtPUigZVoTrOD9Gue1wUA2UVgFoC7rXnGdA
6go to this link and enable => Less secure app access
7
8'''
9
10server = SMTP('smtp.gmail.com',587) # TLS => 587  OR  SSL => 465  (TLS is more secure) 
11server.starttls()
12server.login('Sender@gmail.com','Sender_Password')
13server.sendmail('Sender@gmail.com','Receiver@gmail.com','message here')
14server.quit()
15