I have a script for sending emails using SMTP_SSL. The code is working fine in PyCharm but in the terminal I get an error.
This is the code:
import smtplib s = smtplib.SMTP_SSL("smtp.googlemail.com:465") mml=input("enter your email address :\n") str(mml) passr=input("enter your pass:\n") str(passr) s.login(mml,passr) em = input("please type the email you want to send :\n") str(em) a = input("please type the message:\n") str(a) s.sendmail(mml,em,a) print("\nEmail Was Sent..:)") When I run this in my terminal its giving this after i enter the email:
enter your email address : [email protected] Traceback (most recent call last): File "medo.py", line 3, in <module> mml=input("enter your email address :\n") File "<string>", line 1 [email protected] ^ SyntaxError: invalid syntax When I am trying to put the email between quotes, e.g. "[email protected]" its working fine.
How can I run my script in the terminal?
str(mml),str(passr),str(em), andstr(a)supposed to do?str(a)ands.sendmail(mml,em,a)indented? Whitespace is significant in Python—you should get anIndentationErrorhere. Please make sure your question exactly reflects your code. We have no way of knowing which errors are significant.