2
逗號分隔字符串我已經在我的控制下:輸出常規列表中GSP
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 ...
根據電子郵件規範(http://www.faqs.org/rfcs/rfc2822.html),逗號是要走的路。一些MS產品在過去曾遇到過這個問題,btw,(http://support.microsoft.com/kb/820868),但我認爲逗號是你將能夠做到的最好的。 –