【问题标题】:Python Shell SMTP debugging server error (Django)Python Shell SMTP 调试服务器错误(Django)
【发布时间】:2013-11-25 02:49:10
【问题描述】:

我正在尝试使用 SMTP 服务器测试从 python shell 发送邮件。 我进入了python shell,然后……

python -m smtpd -n -c DebuggingServer localhost:1025

但我收到此错误

File "<console>", line 1
python -m smtpd -n -c DebuggingServer localhost:1025
              ^
SyntaxError: invalid syntax

任何线索如何解决这个问题?谢谢。

【问题讨论】:

标签: python django smtp


【解决方案1】:

蟒蛇壳?我认为您应该直接在 Windows 的 cmd 或其他操作系统的终端中使用“python -m smtpd -m -n -c ...”。

如果你想在 python shell 中使用,试试 os.system 或 os.popen

【讨论】:

    【解决方案2】:

    你输入的命令python -m smtpd -n -c DebuggingServer localhost:1025不是shell命令。 该命令必须直接从终端或命令提示符处执行。 注意:该命令可能需要 sudo 权限才能启动 smtp 服务器。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-06-13
      • 2016-01-05
      • 2010-11-09
      • 2020-06-14
      • 2014-11-15
      相关资源
      最近更新 更多