I know there are a lots of how to send mail questions before, but does sending mail from python scripts not work anymore? I've tried to use the SMTP lib with the following script:
import smtplib
fromaddr = 'mymail@gmail.com'
toaddr = 'someones@gmail.com'
msg = "\r\n".join([
"From: mymail@gmail.com",
"To: someonesmail@gmail.com",
"Subject: Just a message",
"",
'Why, oh why?'
])
username = 'mymail@gmail.com'
pwd = 'mypassword'
server = smtplib.SMTP('smtp.gmail.com:587')
server.ehlo()
server.starttls()
server.login(username, pwd)
server.sendmail(fromaddr, toaddrs, msg)
server.quit()
But it says to login via a web browser, and this post says that google now uses an api to send mails. So, having confusion about the possibility to send mails via scripts without using any of google's api, Is it possible?