问题标签 [django-mailer]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
300 浏览

django - 在 django 中延迟发送电子邮件?

有没有一种简单的方法可以稍后发送电子邮件,比如 2012 年 8 月 1 日下午 6 点?我试图阅读一些关于 django-mailer 的文档,但我无法得到答案。

我开始从事 Web 开发,因此可能无法破解 django-mailer 的现有应用程序来完成这项工作。

0 投票
1 回答
545 浏览

django - 在所有应用程序中替换 django.core.mail.send_mail()?

django.core.mail.send_mail()是否可以用自定义替换对整个项目(包括我的 INSTALLED_APPS 中的第三方项目)的调用send_mail()

我正在将 django-mailer 与我的项目集成,它提供send_mail()django.core.mail.send_mail(). 由于两者都使用相同的函数签名,文档建议在您通常导入 Django 提供的版本的地方导入 django-mailer 版本,如下所示:

这适用于我自己的应用程序代码,但我也想在使用django.core.mail.send_mail(). 现在,当这些应用程序尝试发送电子邮件时,我遇到了错误。

Django 是否提供任何类型的钩子来替换django.core.mail.send_mail(),或者是否有解决方法?现在我正在考虑对每个发送电子邮件的第三方项目进行分叉并添加上面的条件导入代码,但这显然并不理想。

0 投票
0 回答
615 浏览

python - Django邮件发送错误

我有单独的 django 项目和一个 python 脚本文件。脚本文件将不依赖于项目(在不同的路径中可用)。

脚本文件会生成一些数据,需要给相应的用户发送邮件。在这种情况下,我正在尝试使用 django 邮件:-

我在我的 python 脚本文件中启用了 django 环境,并将 sys.path 添加到我的 django 项目设置中(所以我可以使用 django 邮件)。

并且在我的脚本中添加了邮件配置代码:-

毕竟这封邮件不能正常工作。因为上述参数不在设置文件中(实际问题是如果我在设置中添加了这个“EMAIL_USE_TLS”参数本身意味着它可以正常工作从我的脚本文件中获取的其他参数。

我的问题是为什么“EMAIL_USE_TLS”这个参数不像其他参数那样从我的脚本文件中获取?

或者

是否需要在设置文件中指定一个“EMAIL_USE_TLS”?

如果我没有在设置中指定 EMAIL_USE_TLS = True 意味着得到以下错误:-

请任何人就此提出建议。

0 投票
1 回答
74 浏览

python - 如何使内置的 password_reset 视图使用 django-mailer?

我在我的网络应用程序上使用django-registration 。我也已经使用 django-mailer 发送了一些通知电子邮件。

Django 注册通过将重置逻辑委托给django.contrib.auth.views.password_reset启用内置密码重置功能(此处) 。

现在该函数不知道 django-mailer。我怎样才能让它使用 django-mailer?我是否必须复制 password_reset 代码?

0 投票
1 回答
1644 浏览

django - django-mailer 得到 [Errno 61] 连接被拒绝

在我的项目中,我通过 Amazon Services 发送邮件。问题是我必须将每日摘要发送给我系统中的所有用户。这就是为什么我认为如果我使用 django-mailer 来处理这样的过程是个好主意。

我可以通过 django.core.send_mail 成功发送邮件。当我尝试使用 mailer 的 send_mail 功能时,正如预期的那样,mailer 将邮件放入队列,但是当我运行 python manage.py send_mail 时,系统无法发送邮件。我检查了日志,它说 [Errno 61] 连接被拒绝。

我在网上搜索,有些帖子说我应该设置一个 smtp 服务器,但这没有意义,因为我可以使用 django 的 send_mail 功能发送邮件。所以我认为这可能与亚马逊配置有关,但我不确定。

任何的想法 ?

0 投票
2 回答
1061 浏览

django - 使用 Django 模块 (django.core.mail) 在 GAE 上发送电子邮件

在将我的应用程序迁移到 GAE 之前,我使用以下代码发送电子邮件并且效果很好:

现在,在迁移到 GAE(在 Python 2.7 上)之后,它就不起作用了。它只是抛出以下错误:

我将 settings.py 文件配置为 follo

有没有人在 GAE 上使用 Django 模块发送电子邮件并知道该错误的一些信息?

0 投票
1 回答
80 浏览

django - django-mailer creates multiple db entries from email address

I've just implemented django-mailer as it seemed to be the best way to send mail asynchronously from django.

For some reason, django-mailer is creating a db entry for each letter of the recipient's email address, with the "To" field having one letter in it.... Here's a screenshot:

http://i.imgur.com/Pqbx3oq.gif

I've cut off the rest of the entries so as not to show the full address, but suffice it to say that the "To" fields of all the entries add up to the user's email address. (To clarify, sending one email creates an object for each letter of the email address).

The code which generates the mail is:

Outputting user_email in the notification-email gives the whole email address correctly, so I'm assuming that this is a problem with the django-mailer save function....?

Very grateful for any pointers.

0 投票
4 回答
9858 浏览

django - Testing Django email backend

In my settings.py, I put:

So even when importing from from django.core.mail import send_mail, the send_mail function still queues up the email in the database instead of sending it immediately.

It works just fine when actually running the website, but when testing the website, and accessing some webpages that trigger emails, emails are no longer queued anymore:

How come it doesn't seem to be using the backend when it is testing? (importing send_mail from mailer itself gets the tests to pass, but I can't really change the imports of other mailing apps like django-templated-email)

0 投票
9 回答
284584 浏览

django - RuntimeWarning:DateTimeField 收到一个天真的日期时间

我正在尝试使用 IPython 发送一封简单的邮件。我没有设置任何仍然出现此错误的模型。可以做什么?

错误:/home/sourabh/Django/learn/local/lib/python2.7/site-packages/django/db/models/fields/init .py :827:RuntimeWarning:DateTimeField 收到一个幼稚的日期时间(2013-09-04 14:14:13.698105),而时区支持处于活动状态。运行时警告)

尝试过:第一步是添加USE_TZ = True到您的设置文件并安装pytz(如果可能)。

错误改变:

0 投票
1 回答
604 浏览

python - 密码重置-发送邮件不起作用

这是我的代码,当我输入我的邮件并单击提交时,它正确重定向到下一页但邮件没有发送,这个代码有什么 pblm