简体   繁体   中英

Python Shell SMTP debugging server error (Django)

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.

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

The command you enter python -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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM