Answers for "python send google mail"

1

python send google email

from smtplib import SMTP

'''
!!! Note !!!
https://myaccount.google.com/u/1/lesssecureapps?gar=1&pli=1&rapt=AEjHL4MdKbqmGDVY3kiBYKtpeM_epFUujma99D11-QkUh52EZnY1B077b6t81iePtPUigZVoTrOD9Gue1wUA2UVgFoC7rXnGdA
go to this link and enable => Less secure app access

'''

server = SMTP('smtp.gmail.com',587) # TLS => 587  OR  SSL => 465  (TLS is more secure) 
server.starttls()
server.login('[email protected]','Sender_Password')
server.sendmail('[email protected]','[email protected]','message here')
server.quit()
Posted by: Guest on August-25-2021

Python Answers by Framework

Browse Popular Code Answers by Language