0
私は基本的な電子メールを次のコードとともにpythonで送信しようとしていましたが、ブラウザを使用してサインインするとエラーが発生します。私はそれをやったが、同じエラーを吐き出す。 コード:Pythonで電子メールを送信する簡単なスクリプト
import smtplib
server = smtplib.SMTP('smtp.gmail.com', 587)
server.starttls()
server.login("[email protected]", "redacted")
msg = "Your security system has detected an intrusion of some kind please refere to http://projetotig6.orgfree.com/ for an image of the current situation"
server.sendmail("[email protected]", "[email protected]", msg)
server.quit()
そして、私はそれが
[email protected]:~/Desktop$ python3 tent.py
Traceback (most recent call last):
File "tent.py", line 5, in <module>
server.login("[email protected]", "redacted")
File "/usr/lib/python3.4/smtplib.py", line 639, in login
raise SMTPAuthenticationError(code, resp)
smtplib.SMTPAuthenticationError: (534, b'5.7.14 <https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbtT\n5.7.14 NJKUGchcZYhLMqcl9utRyvWa6jwkzOCuhBtdP3URW63HNIVrSlue8To8yKxxbDIwvlnO2g\n5.7.14 V2GooN21jsn0X8_d6W_CxGwuOXmBrkoDzFCqqbB72xz3MbY0Kj3Z7ZzdXlQCc8sjdavwes\n5.7.14 bUlIhA8GIqRKJAyBbildXtsSqF8Fh_7AYPI0W3SKlidhoUOK7o4hI0IIUmgVdqOCpFpxyU\n5.7.14 fvShqxoTn6W_bAWqXfS5akND40-gQ> Please log in via your web browser and\n5.7.14 then try again.\n5.7.14 Learn more at\n5.7.14 https://support.google.com/mail/answer/78754 c142sm10923092wme.18 - gsmtp')
https://support.google.com/mail/answer/78775?hl=en – danidee
は、私はすでにそのページ上のすべてのものを踏襲言及し忘れました。私はPOPとIMAPを有効にしました。添付ファイルを送信しないSMTPサーバーに接続できます。エラーを引き起こす可能性があるのはssl/TSLのことだけですが、私はそれを理解していないのでここに投稿しました。 – grenskul
あなたはパブリックであなたのパスワードを表示していることに気づきます... – danidee