1

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.

Charles
  • 50,943
  • 13
  • 104
  • 142
user3014093
  • 389
  • 2
  • 5
  • 20
  • One can find solution here regarding the problem: http://stackoverflow.com/questions/14019578/python-django-smtp-debugserver-doesnt-catch-emails – Jay Modi Dec 19 '15 at 10:13

2 Answers2

1

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

Priestch
  • 21
  • 1
  • 4
0

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.

TheAztec
  • 43
  • 8