我正在尝试制作我的第一个电子邮件发送器,代码如下:
import smtplib
server = smtplib.SMTP_SSL('smtp.gmail.com', 465)
server.login("(testemail)", "(pass)")
server.sendmail(
"(testemail)",
"(myemail)",
"this message is from python")
server.quit()
Run Code Online (Sandbox Code Playgroud)
它返回并显示此错误:
AttributeError: partially initialized module 'smtplib' has no attribute 'SMTP' (most likely due to a circular import)
Run Code Online (Sandbox Code Playgroud)
对于上下文,我没有将其保存为 email.py