1

当我的网络应用程序的当前用户选择将使用 Gmail 向他们发送电子邮件的其他用户时,我想将他重定向到 gmail 撰写(链接),然后键入他的消息。

在我的 django 视图中,在单击“Mail To”之前,我已经检索了一个 distination 用户列表。是否有可能将这些用户影响到 gmail 中的目的地?

4

1 回答 1

0

如果你想包含多个收件人,那么在模板中这样做:

<a href="mailto:{% for user in users %}{% if not forloop.last %}{{ user.email }},{% else %}{{ user.email }}{% endif %}{% endfor %}">Send email</a>

这是 jsfiddle 中的一个示例。您还可以添加主题和正文:

<a href="mailto:abc@gmail.com,cde@gmail.com?subject=test subject&body=hi there" target="_blank">Send email with subject and body</a>

在此处查看更多提示和技巧

于 2013-06-19T12:10:13.490 回答