Python / Django SMTP DebugServer没有抓到电子邮件 [英] Python/Django SMTP DebugServer doesn't catch emails

查看:446
本文介绍了Python / Django SMTP DebugServer没有抓到电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以这种方式启动服务器(在mac上):

I'm starting the server (on mac) this way:

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

,我没有收到任何错误或任何其他通知。我想这意味着所有的都可以,如果我错了,请纠正我。

and i don't get any errors or any other notifications. I guess it means all is ok, correct me if i'm wrong.

但是当我从django shell或从我的应用发送电子邮件时,使用send_mail / mail_managers with fail_silently = False,我没有看到smtpd调试服务器上的任何输出。我没有任何SMTPErrors,send_mail / mail_managers返回1。

But when i send emails from django shell or from my app, using send_mail/mail_managers with fail_silently=False, i dont see any output on smtpd debug server. I dont get any SMTPErrors, and send_mail/mail_managers returns 1.

我跑了:

lsof -i | grep LISTEN

查看是否有人收听9999的端口,不,没有人。这是否意味着smtp调试服务器有问题?是否应该在听众列表上显示?

to see if anyone listens to port 9999, and nope, no one does. Does it mean that something wrong with smtp debug server? Is it supposed to show on the list of listeners?

我的电子邮件设置:

EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'
EMAIL_HOST = 'localhost'
EMAIL_PORT = 9999


推荐答案

我想你需要使用默认的smtp后端

I think you need to use the default smtp backend

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'

这篇关于Python / Django SMTP DebugServer没有抓到电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆