python ile email gonderme (smtp gmail)-(sending email with python)


import smtplib
fromaddr = "AAA@gmail.com"
toaddrs  = "BBB@gmail.com"
msg = "hello world : ) "

# Credentials (if needed)
username = "ccc"
#your gmail user name above
password = "*****"
#your gmail user password above

# The actual mail send
server = smtplib.SMTP("smtp.gmail.com:587")
server.starttls()
server.login(username,password)
server.sendmail(fromaddr, toaddrs, msg)
server.quit()

not: smtplib python libs klasörü içerisinde yer almaktadır.
(smptlib library is in python libs folder)