I'm trying to make a python script that emails me stuff and i followed this tutorial about how to do it and i thought of making it work using SMTP_SSL()
import smtplib, ssl port = 465 password = input("Type your password and press enter: ") context = ssl.create_default_context() sender_email = "[email protected]" receiver_email = "[email protected]" message = """\ Subject: Hi there This message is sent from Python.""" with smtplib.SMTP_SSL("smtp.gmail.com", port, context=context) as server: server.login(receiver_email, password) server.sendmail(sender_email, receiver_email, message) But it keeps giving me this error:
ImportError: cannot import name 'SMTP' from partially initialized module 'smtplib' (most likely due to a circular import) Can anyone help me clarify what this error means and if there's a workaround for it. Any help appreciated.