Reputation: 409
I am trying to test sending mail from the python shell with an SMTP server. I entered the python shell and then...
python -m smtpd -n -c DebuggingServer localhost:1025
but I receive this error
File "<console>", line 1
python -m smtpd -n -c DebuggingServer localhost:1025
^
SyntaxError: invalid syntax
Any clue how to fix this? Thanks.
Upvotes: 1
Views: 1253
Reputation: 23
The command you enterpython -m smtpd -n -c DebuggingServer localhost:1025
is not a shell command.
The command has to be directly executed from the terminal or the command prompt.
Note: The command might need sudo privilege to start the smtp server.
Upvotes: 0
Reputation: 109
python shell? I think you should use the the "python -m smtpd -m -n -c ..." directly in the cmd of Windows or terminal of someother OS.
if you want to use in the python shell, try os.system or os.popen
Upvotes: 1