1

I am trying to make my first email sender, here's the code:

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()

It returns with this error:

AttributeError: partially initialized module 'smtplib' has no attribute 'SMTP' (most likely due to a circular import)

For context, I did not save it as email.py

Jonathan
  • 63
  • 1
  • 6

1 Answers1

5

As snakecharmerb mentioned in a comment:

You should change the file name of any of the following files in your project:

  • smtplib.py
  • email.py
  • datetime.py
  • sys.py
  • io.py
  • base64.py
  • hmac.py
  • copy.py
  • re.py
  • socket.py.
thom747
  • 805
  • 5
  • 18