我通过谷歌应用向使用Django的用户发送邮箱.

When the user receives emails sent from the Django app, they are from:
do_not_reply@domain.com

when looking at all emails in the inbox, people see the email's sender as :
do_not_reply or do_not_reply@domain.com depending on the email client used

If I log into that "do_not_reply" account using the browser and Google Apps itself and then send an email to myself, the emails are from:
Dont Reply<do_not_reply@domain.com>

As a result, the name displayed for the email's sender in the inbox is:
Dont Reply

在Django中,有没有一种方法可以在用于发送邮箱的邮箱帐户上附加一个"名称"?

I have reviewed Django's mail.py, but had no luck finding a solution
http://code.djangoproject.com/browser/django/trunk/django/core/mail.py?rev=5548

使用:

谢谢

推荐答案

实际上,你可以使用"Dont Reply <do_not_reply@domain.com>"作为你发送邮件的地址.

在django项目的shell中try 以下方法,以测试它是否也适用于gapps:

>>> from django.core.mail import send_mail
>>> send_mail('subject', 'message', 'Dont Reply <do_not_reply@domain.com>', ['youremail@example.com'])

Django相关问答推荐

把Django测试和testcafe结合起来?

Django为什么我的post.count_view递增2?

情节主题更改问题

查询 django 模型以找到当月最好的公司销售

所有子元素的Django自递归外键过滤器查询

django 在 ubuntu 中安装在哪里

在 django 中获取本地时区

更新Django模型对象多个字段的有效方法

如何在python中遍历httprequest post变量

Django:如何使用动态(非模型)数据预填充 FormView?

如何创建一个在复选框右侧显示复选框标签的 Django 表单?

Matplotlib - Tcl_AsyncDelete:异步处理程序被错误的线程删除?

获取 django 应用的绝对路径

如何使 Django 表单字段仅包含字母数字字符

如何使 Django 的开发服务器公开?

为整个结果集向 Django Rest Framework 结果添加额外数据

过滤查询参数

运行单元测试时禁用 Django South?

Django:如何从模板中识别调用视图?

AttributeError:ManyRelatedManager对象没有add属性?