简体   繁体   English

在Webforms中打开邮件客户端的几个实例

[英]open several instances of mail client in webforms

I have a list of mail adresses, CCs, subjects, bodies,... and want to open each in a seperate mail client window. 我有邮件地址,抄送,主题,正文等的列表,并希望在单独的邮件客户端窗口中打开它们。 Right now I am just doing 现在我正在做

form.Controls.Add(new LiteraclControl("<script>window.location.href = 'mailto:example@example.com?cc=&subject=ExampleSubject&body=ExampleBody'</script>"));

for each set of mail info I have. 对于我拥有的每组邮件信息。 I tried putting each window.location.href in the same script block, seperated by ; 我尝试将每个window.location.href放在同一脚本块中,以;分隔; .

I know that this probably isn't the best practice, but I don't know how to do it in another way. 我知道这可能不是最佳做法,但我不知道如何通过其他方式进行。

The Problem with this is that it only opens the last mailto 问题是它仅打开最后一个mailto

For anyone wondering, I now use window.open('mailto:test@test.com?cc=&subject=testsubhect&body=testbody', '_top') . 对于任何想知道的人,我现在使用window.open('mailto:test@test.com?cc=&subject=testsubhect&body=testbody', '_top') Make sure to use the 'top' parameter, otherwise it will open a blank tab for each time this function is called. 确保使用'top'参数,否则每次调用此函数都会打开一个空白选项卡。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM