Python smtplib: Gmail works, but only “sometimes”

前端 未结 1 1879
暗喜
暗喜 2021-01-29 05:36

I wrote a simple script to send an email via the Gmail SMTP server. Here the code:

import smtplib
msg = \'Hello World!\'
server = smtplib.SMTP(\'smtp.gmail.com\'         


        
相关标签:
1条回答
  • 2021-01-29 06:04

    The answer recommends enabling access for less secure apps first. If that does not work you could try visiting the link, which is supplied on that page: https://www.google.com/accounts/DisplayUnlockCaptcha

    This may enable access.

    0 讨论(0)
提交回复
热议问题