我的控制器中有以下内容:
render(view: "create", model: [dealInstance: dealInstance, storeName: params.storeName, location: params.location, openEmailClient: true, emailTo: users*.email])
以下是我的create.gsp:
$(document).ready(function () {
<g:if test="${openEmailClient}">
<g:set var="subject" value="${g.message(code: 'deal.created.email.subject')}" scope="page" />
<g:set var="body" value="${g.message(code: 'deal.created.email.body')}" scope="page" />
window.location.href = "mailto:${emailTo}?subject=${subject}&body=${body}";
</g:if>
});
这将打开默认电子邮件客户端并填充“收件人”字段。
如何将电子邮件列表转换为以逗号分隔的字符串? (这是否正确?大多数电子邮件客户端是否会接受逗号作为电子邮件分隔符?)
即。一个@ a.com,B @ b.com ...