ssl - Whats wrong with this script? - python, gmail, smtp_ssl -


haven't used python in time, need script email myself alerts etc.

why wont work? switched using ssl after gmail told me insecure app tried access.

# import smtplib actual sending function import smtplib  # import email modules we'll need email.mime.text import mimetext  msg = mimetext("test file")  me = 'me@gmail.com' = me  msg['subject'] = 'this test'  msg['from'] = me msg['to'] =  #username , password here username = 'username' password = 'password'   # send message via gmail ssl s = smtplib.smtp_ssl('smtp.gmail.com:465') s.login(username,password) s.send_message(msg) s.quit() 

the error when attempt run follows:

traceback (most recent call last):   file "f:\desktop\emailtest.py", line 24, in <module>     s.login(username,password)   file "f:\python34\lib\smtplib.py", line 652, in login     raise smtpauthenticationerror(code, resp) smtplib.smtpauthenticationerror: (534, b'5.7.14 <https://accounts.google.com/continuesignin?sarp=1&scc=1&plt=akgnsbsjy\n5.7.14 dzytmh_1-mwcm6vosq8erg0exrr-ozq6-shmu4noqjderpdzo62-zic2gpmtlnj3u5-qxj\n5.7.14 zt3qrgtco7d5zpj8uto2vvtfu1g2rmmwfbwpvavpd8__gavcwhwszps1gzzqxnxjbqd1da\n5.7.14 ex-9is6nxe9-giahafj5fryml1r0qr1wcuh9temrdjx4klo1xx4bhpbmj5gj7imrzrlzuv\n5.7.14 ngg0balrwwzuk1ssd_bqptge15rg> please log in via web browser and\n5.7.14 try again.\n5.7.14  learn more at\n5.7.14  https://support.google.com/mail/answer/78754 uo9sm14972088wjc.49 - gsmtp') 


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -