使用密件抄送“隐藏"地址向多个收件人发送电子邮件-Django 1.6 [英] Send email to multiple recipients with bcc 'hidden' address - Django 1.6

查看:73
本文介绍了使用密件抄送“隐藏"地址向多个收件人发送电子邮件-Django 1.6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Django 1.6上开发应用程序

I'm developing an app on Django 1.6

在此应用程序中,有一个部分,发布项目的用户可以从该部分收到对这个项目感兴趣的自由职业者的消息.

In this app, there is a section, where a User which publishes a project can receive a message from a freelancer interested into this project.

到目前为止,这是我拥有的代码:

So far this is the code I have:

# Send email
        if user_profile.contracting:
            subject = _('Your question on project {} has been answered')
            body = _('You can read your answer here {}')
            email = question.user.email

        else:
            subject = _('Your have a new question on project {}')
            body = _('You can read your question here: {}')
            email = project.user.email

        send_mail(subject.format(project.name),
                  body.format(
                      os.environ.get('CURRENT_URL') + '/' +
                      reverse('projects_id', args=(project.id,))[1:]),
                  'no_responder@contratalos.com', [email, 'info@contratalos.com'])

        return HttpResponseRedirect(reverse('projects_id',
                                            args=(project.id,)))

    else:
        d = {'form': ProjectMessagesForm(request.POST)}
return render_to_response('projects/questions.html', d,
                          context_instance=RequestContext(request))

如果您看这行:

no_responder@contratalos.com', [email, 'info@contratalos.com'])

我要添加先前的电子邮件"声明和另一个收件人 info@contratalos.com ,第二个收件人失败,我没有收到任何错误消息,但是消息未发送.

I'm adding the previous 'email' declaration and another recipient info@contratalos.com, this second recipient fails, I don't receive any error message, but the message is not sent.

我不知道可能是什么原因...因为我没有任何追溯...

I don't know what the cause could be... Since I don't have any traceback to it...

有什么想法吗?

编辑

此行有效:

no_responder@contratalos.com', [email, 'info@contratalos.com'])

但是我只需要使 info@contratalos.com 成为密件抄送地址,即对 email 用户不可见.

But I just need to make info@contratalos.com to be like a bcc address, I mean invisible to the email user.

推荐答案

没关系,消息有延迟,现在我收到了,哈哈,谢谢!

Nevermind, the message had a delay, now I received it, lol, Thanks!

这篇关于使用密件抄送“隐藏"地址向多个收件人发送电子邮件-Django 1.6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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