从 WinJS 发送邮件 [英] Sending a mail from WinJS
本文介绍了从 WinJS 发送邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在标准的 Windows 8 Javascript Store 应用中有以下代码:
I have the following code in a standard Windows 8 Javascript Store App:
var test = document.getElementById("testButton");
test.addEventListener("click", function () {
var mailto = new Windows.Foundation.Uri("mailto:?to=my.address@here.com" + "&subject=test" + "&body=Hello,<br>How are you?");
Windows.System.Launcher.launchUriAsync(mailto);
我遇到的问题是,无论我做什么,都无法在Hello,
和How are you?
之间得到回车.我试过 \n
&<代码>\r\n代码>.我需要插入什么才能得到回车?
The problem I have is that no matter what I do, I can't get a carriage return between Hello,
and How are you?
. I've tried \n
& \r\n
. What do I need to insert to get a carriage return?
推荐答案
既然是 URL,就必须使用 URL 编码字符:
Since it's a URL, you'll have to use a URL encoded character:
var mailto = new Windows.Foundation.Uri("mailto:?to=my.address@here.com" + "&subject=test" + "&body=Hello,%0dHow are you?");
这篇关于从 WinJS 发送邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文