sending email with python and error message keeps popping up

Viewed 946

I am trying to send an email with python and getting errors. Here is my code:

import smtplib

server = smtplib.SMTP('smtp.gmail.com', 465)


server.login("someone@gmail.com", "pass")


msg = "Hello!"
server.sendmail("someone@gmail.com", "someone@gmail.com", msg)
print("Sent")

This is the error I keep getting

    Traceback (most recent call last):
  File "C:/Users/me/Desktop/Python/email65.py", line 1, in <module>
    import smtplib
  File "C:\Users\me\AppData\Local\Programs\Python\Python36-32\lib\smtplib.py", line 47, in <module>
    import email.utils
  File "C:/Users/me/Desktop/Python\email.py", line 1
    import smtplib from email.mime.multipart
                      ^
SyntaxError: invalid syntax`

What am I doing wrong?

3 Answers
Related