My email program will not send – written in Python

I have here some Python code to send an email, but it will not send, and will give me an error. The code is listed below:

import smtplib
#SERVER = "localhost"

FROM = "[email protected]'

TO = ["[email protected]"]

SUBJECT = "Hello!"

TEXT = "This message was sent with Python's smtplib."

message = """
From: %s
To: %s
Subject: %s

""" % (FROM, ", ".join(TO), SUBJECT, TEXT)

server = smtplib.SMTP('myserver')
server.sendmail(FROM, TO, message)

It will keep throwing the same error, no matter what the code is:

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

Can anyone help?


Perhaps this has the solution if your module is named No attribute ‘SMTP’, error when trying to send email in Python It would seem smtplib also has an and a collision is occurring. My $0.02 worth. Please have mercy. I’m also new to StackOverflow.